hm_get: Extract the slot

Description Usage Arguments Value Functions Examples

Description

Get the table (or metadata) that you want from an hydromet or hydromet_XXX class.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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.

Value

The required data frame or metadata.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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)')])

# now extract the slot of air temperature
head( hm_get(obj = hm_cuevas, slot_name = 'tair') )

hydrotoolbox documentation built on July 9, 2021, 1:06 a.m.