modify_hydroMet {hydroToolkit} | R Documentation |
Modify data inside a specific slot
Description
Apply a pre-defined (e.g.: movAvg, fill_value or Qmm_to_Dm) or user defined function to an existing series inside a slot.
Usage
modify_hydroMet(
obj,
name = NA_character_,
colName = NA_character_,
colNum = 2,
FUN = NULL,
...
)
## S4 method for signature 'hydroMet_BDHI'
modify_hydroMet(
obj,
name = NA_character_,
colName = NA_character_,
colNum = 2,
FUN = NULL,
...
)
## S4 method for signature 'hydroMet_CR2'
modify_hydroMet(
obj,
name = NA_character_,
colName = NA_character_,
colNum = 2,
FUN = NULL,
...
)
## S4 method for signature 'hydroMet_DGI'
modify_hydroMet(
obj,
name = NA_character_,
colName = NA_character_,
colNum = 2,
FUN = NULL,
...
)
## S4 method for signature 'hydroMet_IANIGLA'
modify_hydroMet(
obj,
name = NA_character_,
colName = NA_character_,
colNum = 1,
FUN = NULL,
...
)
Arguments
obj |
hydroMet_XXX subclass object. See hydroMet_BDHI, hydroMet_DGI, hydroMet_IANIGLA or hydroMet_CR2. |
name |
string with the slot name of the data frame. |
colName |
string with the new column name (from |
colNum |
numeric value with the data frame column where to apply |
FUN |
the function name. |
... |
|
Value
The same hydroMet subclass provided in obj
with an extra column.
Functions
-
modify_hydroMet,hydroMet_BDHI-method
: modify method for BDHI class -
modify_hydroMet,hydroMet_CR2-method
: modify method for CR2 class -
modify_hydroMet,hydroMet_DGI-method
: modify method for DGI class -
modify_hydroMet,hydroMet_IANIGLA-method
: modify method for IANIGLA class
Examples
# 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')
# Now 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") )