hm_name: Set new column names

Description Usage Arguments Value Functions Examples

Description

Change slot's column names.

Usage

1
2
3
4
5
6
7
hm_name(obj, slot_name, col_name)

## S4 method for signature 'hydromet_station'
hm_name(obj, slot_name, col_name)

## S4 method for signature 'hydromet_compact'
hm_name(obj, slot_name, col_name)

Arguments

obj

a valid hydromet_compact class object.

slot_name

string with the a valid name.

col_name

string vector with new column names.

Value

The same object but with new column names.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# path to all example files
path <- system.file('extdata', package = 'hydrotoolbox')

# we first build the snih station file
guido <-
hm_create() %>%
  hm_build(bureau = 'snih', path = path,
           file_name = c('snih_hq_guido.xlsx',
           'snih_qd_guido.xlsx'),
           slot_name = c('hq', 'qd'),
           by = c('none', 'day') )

 guido %>% hm_show(slot_name = 'qd')

# now we can change default names
hm_name(obj = guido, slot_name = 'qd',
        col_name = 'q(m3/s)') %>%
        hm_show(slot_name = 'qd')

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