hm_name: Set new column names

hm_nameR Documentation

Set new column names

Description

Change slot's column names.

Usage

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_* 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

  • hm_name(hydromet_station): set new column name for station class

  • hm_name(hydromet_compact): set new column name for compact class

Examples

## Not run: 
# 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')

## End(Not run)


hydrotoolbox documentation built on April 14, 2023, 12:34 a.m.