Created
September 25, 2016 21:35
-
-
Save dholstius/89f0dd48bc1599f67a1c9592303b6ad4 to your computer and use it in GitHub Desktop.
Try to replicate Sum aggregator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(htmlwidgets) | |
library(rpivotTable) | |
mtcars %>% | |
rpivotTable(rows = "gear", | |
cols = c("cyl", "carb"), | |
vals = "hp", | |
# Step 1. Make this line accomplish the same thing as the default | |
# (in other words, it should really have no effect). | |
# | |
# Step 2. Fold in `numberOfDigits`. | |
# | |
# Step 3. Celebrate! | |
# | |
aggregators = htmlwidgets::JS('{ Sum : $.pivotUtilities.aggregatorTemplates.sum() }'), | |
aggregatorName = "Sum") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is far from obvious, so very good question. Here is a (hacky) way to accomplish.