Time_aggregate {ARPALData}R Documentation

Aggregate ARPALdf data to hourly, daily, weekly, mothly and yearly aggregations


'Time_aggregate' returns an ARPALdf object aggregating observations by hourly, daily, weekly and mothly periods. The function can be applied only to ARPALdf objects. User can indicate specific variables to aggregate and an aggregation function among mean,median,sum (cumulated),min,max and quantile for each variable. It is possible to specify different aggregation functions on the same variable by repeating the name of the variable in Var_vec and specifying the functions in Fns_vec.


Time_aggregate(Dataset, Frequency, Var_vec = NULL, Fns_vec = NULL, verbose = T)



ARPALdf dataframe to aggregate.


Temporal aggregation frequency. It can be "hourly", "daily", "weekly", "monthly" or "yearly.


Vector of variables to aggregate. If NULL (default) all the variables are averaged, expect for 'Temperature' and 'Snow_height' which are summed.


Vector of aggregation function to apply to the selected variables. Available functions are mean, median, min, max, sum, qPP (PP-th percentile), sd, var, vc (variability coefficient), skew (skewness) and kurt (kurtosis). Attention: for Wind Speed and Wind Speed Gust only mean, min and max are available; for Wind Direction and Wind Direction Gust only mean is available.


Logic value (T or F). Toggle warnings and messages. If 'verbose=T' (default) the function prints on the screen some messages describing the progress of the tasks. If 'verbose=F' any message about the progression is suppressed.


A data frame


## Download hourly observed concentrations from all the stations in the network during 2019.
data <- get_ARPA_Lombardia_AQ_data(ID_station=NULL,Year=2020,Frequency="hourly")
## Aggregate all the data to daily frequency
## Aggregate NO2 to weekly maximum concentrations and NOx to weekly minimum concentrations.

[Package ARPALData version 1.2.2 Index]