inst/examples/sorting.R

library(rpivotTable)

rpivotTable(HairEyeColor, 
            rows = c("Eye"), 
            cols = c("Hair"),
            rendererName = "Table Barchart",
            aggregatorName="Sum", vals="Freq",
            sorters = "
            function(attr) { 
            var sortAs = $.pivotUtilities.sortAs;
            if (attr == \"Hair\") { 
            return sortAs([\"Red\", \"Brown\", \"Blond\", \"Black\"]);
            } 
            }")

Try the rpivotTable package in your browser

Any scripts or data that you put into this service are public.

rpivotTable documentation built on May 1, 2019, 9:11 p.m.