I would like help about pivot table (from pivottabler) and export into word document (by Rmarkdown step).
In my daily work, I export my tables in Excel file, but for the annual report I would like to export the summary tables in word document automatically and keeping the format. I tryed to export in html and latex or in converting pivottable values into dataframe but didn't work.
Could someone help me please? Either show me the technique with this package, or tell me with which other package easily exportable in R markdown I could easily reproduce (and identically) my tables ?
library(pivottabler)
pt <- PivotTable$new()
pt$addData(bhmtrains)
pt$addColumnDataGroups("TrainCategory")
pt$addRowDataGroups("TOC",
outlineBefore=list(isEmpty=FALSE,
groupStyleDeclarations=list(color="blue")),
outlineTotal=list(groupStyleDeclarations=list(color="blue")))
pt$addRowDataGroups("PowerType", addTotal=FALSE)
pt$addRowDataGroups("SchedSpeedMPH", addTotal=FALSE)
pt$defineCalculation(calculationName="TotalTrains", summariseExpression="n()")
pt$renderPivot()
