Get the table (or metadata) that you want from an hydromet or hydromet_XXX class.
hm_get(obj, slot_name =NA_character_)## S4 method for signature 'hydromet'hm_get(obj, slot_name =NA_character_)## S4 method for signature 'hydromet_station'hm_get(obj, slot_name =NA_character_)## S4 method for signature 'hydromet_compact'hm_get(obj, slot_name =NA_character_)
Arguments
obj: an hydromet or hydromet_XXX class object.
slot_name: string with slot to extract.
Returns
The required data frame or metadata.
Functions
hm_get(hydromet): get method for generic hydromet object
hm_get(hydromet_station): get method for station class
hm_get(hydromet_compact): get method for compact class
Examples
## Not run:# set path to filepath_file <- system.file('extdata','ianigla_cuevas.csv', package ='hydrotoolbox')# read filecuevas <- read_ianigla(path = path_file, out_name = c('tair(°C)','rh(%)','patm(mbar)','p(mm)','wspd(km/hr)','wdir(°)','kin(kW/m2)','hsnow(cm)','tsoil(°C)'))# create and set one the variableshm_cuevas <- hm_create()%>% hm_set(tair = cuevas[, c('date','tair(°C)')], rh = cuevas[, c("date",'rh(%)')])# now extract the slot of air temperaturehead( hm_get(obj = hm_cuevas, slot_name ='tair'))# extract multiple dataout_list <- list()for(i in c("tair","rh")){ out_list[[ i ]]<- hm_cuevas %>% hm_get(slot_name = i)}## End(Not run)