waterfallPrep: Prepares mulitplicative data for a waterfall plot

Description Usage Arguments Value Examples

Description

waterfallPrep() : a function that takes the data on the reported and evaluated savings values and returns the average permuted values of the multiplicative factors and prepare a data frame that is ready for the waterfall plot in R or Excel

Usage

1
2
waterfallPrep(df, gross.report = 100, NTG.report = 1, NTG.eval = 1,
  altparamnames = NULL, output = "all")

Arguments

df

a dataframe with columns 'params' (character) and 'value' (numeric); column names are immaterial. This is the order dependent value.

gross.report

is the reported gross (ex ante) savings for the program, default is 100

NTG.report

is the percentage of gross assumed net for program, default is 1

NTG.eval

is the percentage of gross evaluated net for program, default is 1

altparamnames

is an optional vector of names for the parameters, default is the names in df[,1]; if supplied, ensure same order as df

output

is an optional request for table, takes "none","gross","net","all", default is "all"

Value

if output is "all", returns a list of 3 dataframes. Else, if output is "gross", or "net", returns a dataframe with columns variable (character), given, total, calc, decrease, increase, and base (numeric). If output is "none" returns the same, less "calc".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 rawparamdf <- data.frame( # lighting example
                         params = c("ISR","deltaWatts","HOU","x"),
                         value = c(0.5, 0.7, 1.2, 1.5),
                         stringsAsFactors = FALSE
                        )
 #assume gross.report is 200, NTG.report is 0.6 & NTG.eval is 0.8
 waterfallPrep(rawparamdf, 200, 0.6, 0.8)

 #To just get the net permute table and rename the variables, example
 waterfallPrep(rawparamdf, 200, 0.6, 0.8,
 altparamnames=c("ISR", "Dif Watts", "Daily Hours", "Control"),
 output = "net")

EMIjess/evalwaterfallr documentation built on May 6, 2019, 3:09 p.m.