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

View source: R/prepSeriesSum.R

prepSeriesSumR Documentation

Prepare a Data Frame to Be Converted to a Series for Use in Highcharter

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

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

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 March 9, 2024, 3:03 a.m.