Description Usage Arguments Value Examples
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
1 2 | waterfallPrep(df, gross.report = 100, NTG.report = 1, NTG.eval = 1,
altparamnames = NULL, output = "all")
|
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" |
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".
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.