Description Usage Arguments Value Examples
This is a useful function to easily aggregate your data.
1 2 3 4 5 6 7 8 9 |
df |
data frame with class |
fun |
string containing one of the following functions: mean, min, max or sum. |
period |
string with the period of aggregation: hourly, daily, monthly, annual or climatic. NOTE: the 'climatic' option returns the all series annual statistics ('fun'). |
out_name |
string with the output column name of the variable to aggregate. |
start_month |
optional. Numeric value of the first month. It only makes sense if the period is annual. |
end_month |
optional. Numeric value of the last month. It only makes sense if the period is annual. |
allow_NA |
optional. Numeric value with the maximum allowed number of |
A data frame with to columns: the date and the aggregated variable.
1 2 3 4 5 6 7 | # Path to file
dgi_path <- system.file('extdata', package = "hydroToolkit")
toscas <- read_DGI(file = 'Toscas.xlsx', sheet = 'tmean', path = dgi_path)
# Monthly mean temperature
m_toscas <- agg_serie(df = toscas, fun = 'mean', period = 'monthly', out_name = 'T_month')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.