I am performing a number of data transformations within R. My manager wants the output to be an excel export with an excel pivot table, with all the features that an excel pivot table offers (such as double clicking to see data makeup). Does anyone know of a way to create excel pivot tables from R? I'm currently considering running VBA code through R just to create that pivot table; but I wanted to know what others think. Thanks!
I came up with a unique solution in case anyone else needs to do this. I create a excel template workbook ahead of time (this can be reused over and over). I have the pivot table look for a specific named table. Then from R, I load in the excel template workbook, load in my data from R into excel using openxlsx. I use openxlsx's feature to create a named data table; naming it the name the pivot table looks for. Then I save the excel file as a new file. The pivot table is automatically populated from the data table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With