Description Usage Arguments Value Functions Examples
This method provides common functions to aggregate the data inside a slot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | agg_hydroMet(
obj,
slot_name,
col_name,
fun,
period,
out_name = NULL,
start_month = NULL,
end_month = NULL,
allow_NA = NULL
)
## S4 method for signature 'hydroMet_BDHI'
agg_hydroMet(
obj,
slot_name,
col_name,
fun,
period,
out_name = NULL,
start_month = NULL,
end_month = NULL,
allow_NA = NULL
)
## S4 method for signature 'hydroMet_DGI'
agg_hydroMet(
obj,
slot_name,
col_name,
fun,
period,
out_name = NULL,
start_month = NULL,
end_month = NULL,
allow_NA = NULL
)
## S4 method for signature 'hydroMet_CR2'
agg_hydroMet(
obj,
slot_name,
col_name,
fun,
period,
out_name = NULL,
start_month = NULL,
end_month = NULL,
allow_NA = NULL
)
## S4 method for signature 'hydroMet_IANIGLA'
agg_hydroMet(
obj,
slot_name,
col_name,
fun,
period,
out_name = NULL,
start_month = NULL,
end_month = NULL,
allow_NA = NULL
)
|
obj |
an |
slot_name |
a single or vector string containing the slot(s) to aggregate. |
col_name |
a single or vector string with the name of the column to aggregate in |
fun |
a single or vector string containing one of the following functions: mean, min, max or sum. |
period |
a single or vector string with the period of aggregation: hourly, daily, monthly, annual or climatic. NOTE_1: the 'climatic' option returns the all series annual statistics ('fun'). NOTE_2: if the object is of class |
out_name |
optional. Single or vector string with the output column name of the variable to aggregate. |
start_month |
optional. Numeric (or numeric vector) value of the first month. It only makes sense if the period is annual. NOTE: as an example, in case you have just two slots (out of five) that you want to aggregate annually you must provide a vector of length two. Default value is January. NOTE*: if the object is of class |
end_month |
optional. Numeric (or numeric vector) value of the last month. It only makes sense if the period is annual. NOTE: as an example, in case you have just two slots (out of five) that you want to aggregate annually you must provide a vector of length two. Default value es December. NOTE*: if the object is of class |
allow_NA |
optional. Numeric (or numeric vector) value with the maximum allowed number of |
An hydroMet_XXX
class object with the required slot(s) aggregated.
agg_hydroMet,hydroMet_BDHI-method
: aggregation method for BDHI data
agg_hydroMet,hydroMet_DGI-method
: aggregation method for DGI data
agg_hydroMet,hydroMet_CR2-method
: aggregation method for CR2 data
agg_hydroMet,hydroMet_IANIGLA-method
: aggregation method for IANIGLA data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Create BDHI hydro-met station
guido <- create_hydroMet(class_name = 'BDHI')
# List with meteorological variables (slots in BDHI's object)
cargar <- list('precip', 'Qmd', 'Qmm')
# Assign as names the files
hydro_files <- list.files( system.file('extdata', package = "hydroToolkit"), pattern = 'Guido' )
names(cargar) <- hydro_files
# Build the object with the met records
guido <- build_hydroMet(obj = guido, slot_list = cargar,
path = system.file('extdata', package = "hydroToolkit") )
# Aggregrate precipitation serie
guido <- agg_hydroMet(obj = guido, slot_name = 'precip', col_name = 'precip', fun = 'sum',
period = 'monthly', out_name = 'P_month', allow_NA = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.