if (FALSE) {
# set path to file
path_file <- system.file('extdata', 'ianigla_cuevas.csv',
package = 'hydrotoolbox')
# read file
cuevas <-
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 variables
hm_cuevas <-
hm_create() %>%
hm_set(tair = cuevas[ , c('date', 'tair(°C)')],
rh = cuevas[ , c("date", 'rh(%)')])
# now extract the slot of air temperature
head( hm_get(obj = hm_cuevas, slot_name = 'tair') )
# extract multiple data
out_list <- list()
for(i in c("tair", "rh")){
out_list[[ i ]] <-
hm_cuevas %>%
hm_get(slot_name = i)
}
}
Run the code above in your browser using DataLab