R, Excel, Function, Pivot Tables.
The openxlsx Package also allows you to export a plot created in R (e.g., by ggplot2) to a spreadsheet. As illustrated below, I use inserPlot to do the job. Note that inserPlot will insert only the most current plot displayed in R (can be loaded by print function). addWorksheet(diamond.wb,"my