build_hydroMet {hydroToolkit} | R Documentation |
Automatically load native data files
Description
This method is the recommended one for loading your data-sets (as provided by the agency).
Usage
build_hydroMet(
obj,
slot_list,
path = NULL,
col_names = NULL,
start_date = NULL,
end_date = NULL
)
## S4 method for signature 'hydroMet_BDHI'
build_hydroMet(obj, slot_list, path = NULL)
## S4 method for signature 'hydroMet_CR2'
build_hydroMet(obj, slot_list, path = NULL)
## S4 method for signature 'hydroMet_DGI'
build_hydroMet(obj, slot_list, path = NULL)
## S4 method for signature 'hydroMet_IANIGLA'
build_hydroMet(obj, slot_list, path = NULL)
## S4 method for signature 'hydroMet_compact'
build_hydroMet(
obj,
slot_list,
col_names = NULL,
start_date = NULL,
end_date = NULL
)
Arguments
obj |
an |
slot_list |
a list containing (in each element) a vector string with the slot names. The name of the list elements are the native file names (e.g.: Qmd_Guido_BDHI.txt). NOTE: when the |
path |
string with the files directory. If not provided, the method will use the current working directory. NOTE: this argument is harmless for an object of class |
col_names |
it just make sense if |
start_date |
it just make sense if |
end_date |
it just make sense if |
Value
An S4 object of class hydroMet_XXX
with the data loaded in each slot.
Functions
-
build_hydroMet,hydroMet_BDHI-method
: build up method for BDHI class -
build_hydroMet,hydroMet_CR2-method
: build up method for CR2 class -
build_hydroMet,hydroMet_DGI-method
: build up method for DGI class -
build_hydroMet,hydroMet_IANIGLA-method
: build up method for IANIGLA class -
build_hydroMet,hydroMet_compact-method
: build up method forcompact
class
Examples
# Path to file
dgi_path <- system.file('extdata', package = "hydroToolkit")
file_name <- list.files(path = dgi_path, pattern = 'Toscas')
# Read Toscas
var_nom <- list(slotNames(x = 'hydroMet_DGI')[2:7])
names(var_nom) <- file_name
# Load Toscas meteo station data
toscas_dgi <- create_hydroMet(class_name = 'DGI')
toscas_dgi <- build_hydroMet(obj = toscas_dgi, slot_list = var_nom,
path = dgi_path)