This function creates a new virtual sensor on locality within the myClim data object. The virtual sensor represents the cumulative sum of the values on the input sensor. Names of new sensors are original sensor name + outpus_suffix.

mc_calc_cumsum(data, sensors, output_suffix = "_cumsum", localities = NULL)

Arguments

data

cleaned myClim object see myClim-package

sensors

names of sensors on which to calculate cumulative sum

output_suffix

name suffix for virtual sensor names (default "_cumsum") e.g. TMS_T3_cumsum

localities

list of locality_ids for calculation; if NULL then all (default NULL)

Value

The same myClim object as input but with added cumsum sensors.

Details

If value type of sensor is logical, then output type is integer. (TRUE, TRUE, FALSE -> 2)

Examples

cumsum_data <- mc_calc_cumsum(mc_data_example_agg, c("TMS_T1", "TMS_T2"))
#> Warning: Locality A1E05 doesn't contains any sensor TMS_T1. It is skipped.
#> Warning: Locality A1E05 doesn't contains any sensor TMS_T2. It is skipped.