I'm starting to use the rpivotTable
function:
library(rpivotTable)
rpivotTable(mtcars, rows="gear", col="cyl", aggregatorName="Average",
vals="mpg", rendererName="Bar Chart")
With this code I have the average mpg by cyl and gear. What if I would like compute the weighted average mpg with hp? I should create my aggregator! I read here that it's possible. But how then pass it to R ?