View source: R/prepSeriesSum.R
prepSeriesSum | R Documentation |
This function converts a data frame to a summary data frame that can be converted to a series for use in highcharter. The difference between this funciton and prepSeries is that this function uses sum as an aggregation rather than mean.
prepSeriesSum(df, x1, x2, y)
df |
This is the data source to be converted |
x1 |
This is the first column to be grouped by |
x2 |
This is the second column to be grouped by |
y |
This is the column to summarise by taking the mean |
library(dplyr)
dat2 <- prepSeries(mtcars,"cyl","am","mpg") %>% mutate(am = ifelse(am == 1,"Automatic","Manual"))
datSeries <- changeToSeries(dat2,"am")
createColumn(datSeries,unique(dat2$cyl),"Fuel Efficiency","Miles per Gallon by Transmission and Cylinders")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.