View source: R/datafunctions.R
cum_values | R Documentation |
Function to compute cumulative values, i,e. cumulative volumes based on flow values (m3/s) and the dt (s) in the dataset. Cum values are resetted every year.
cum_values(df, debug = F)
df |
the input dataframe, containing <time>, <location>, <variable>, <value> values |
debug |
flag for debug output, default = FALSE |
An R dataframe containing cumnulative values, based on value * dt.
library(Waternet) submod <- c("OXY") locmod <- c("LOX010") df <- get_model_data("DATA/testdata.his", locmod, submod) df.cum <- cum_values(df, debug=T) library(ggplot2) plot <- ggplot(df.cum, aes(time, value.cum)) + geom_line(aes(color = variable), size = 1) + facet_grid((variable ~ location), scales = "free") plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.