prepSeriesSum: Prepare a Data Frame to Be Converted to a Series for Use in...

Description Usage Arguments Examples

View source: R/prepSeriesSum.R

Description

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.

Usage

1
prepSeriesSum(df, x1, x2, y)

Arguments

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

Examples

1
2
3
4
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")

jsdeherrera/shinyBoots documentation built on May 20, 2019, 2:08 a.m.