R, Excel, Function, Pivot Tables.
diamond.wb, respectively. writeData(diamond.wb,"my sheet 1",table1) writeData(diamond.wb,"my sheet 2",table2) writeData(diamond.wb,"my sheet 3",table3) The above repetitive work can be simplified using sapply. That will be a different topic. The three tables are now saved to the workbook diamond.wb