hm_set: Set the data of an 'hydromet' object or its subclass

hm_setR Documentation

Set the data of an hydromet object or its subclass

Description

With this method you can set (or change) an specific slot value (change the table).

Usage

hm_set(
  obj = NULL,
  id = NULL,
  agency = NULL,
  station = NULL,
  lat = NULL,
  long = NULL,
  alt = NULL,
  country = NULL,
  province = NULL,
  river = NULL,
  active = NULL,
  basin_area = NULL,
  basin_eff = NULL,
  other_1 = NULL,
  other_2 = NULL,
  ...
)

## S4 method for signature 'hydromet'
hm_set(
  obj = NULL,
  id = NULL,
  agency = NULL,
  station = NULL,
  lat = NULL,
  long = NULL,
  alt = NULL,
  country = NULL,
  province = NULL,
  river = NULL,
  active = NULL,
  basin_area = NULL,
  basin_eff = NULL,
  other_1 = NULL,
  other_2 = NULL,
  ...
)

## S4 method for signature 'hydromet_station'
hm_set(
  obj = NULL,
  id = NULL,
  agency = NULL,
  station = NULL,
  lat = NULL,
  long = NULL,
  alt = NULL,
  country = NULL,
  province = NULL,
  river = NULL,
  active = NULL,
  basin_area = NULL,
  basin_eff = NULL,
  other_1 = NULL,
  other_2 = NULL,
  hq = NULL,
  hw = NULL,
  qh = NULL,
  qd = NULL,
  qa = NULL,
  qm = NULL,
  wspd = NULL,
  wdir = NULL,
  evap = NULL,
  anem = NULL,
  patm = NULL,
  rh = NULL,
  tair = NULL,
  tmax = NULL,
  tmin = NULL,
  tmean = NULL,
  tsoil = NULL,
  precip = NULL,
  rainfall = NULL,
  swe = NULL,
  hsnow = NULL,
  kin = NULL,
  kout = NULL,
  lin = NULL,
  lout = NULL,
  unvar = NULL
)

## S4 method for signature 'hydromet_compact'
hm_set(
  obj = NULL,
  id = NULL,
  agency = NULL,
  station = NULL,
  lat = NULL,
  long = NULL,
  alt = NULL,
  country = NULL,
  province = NULL,
  river = NULL,
  active = NULL,
  basin_area = NULL,
  basin_eff = NULL,
  other_1 = NULL,
  other_2 = NULL,
  compact = NULL
)

Arguments

obj

an hydromet or hydromet_XXX class object.

id

ANY. This is the ID assigned by the agency.

agency

character. The name of the agency (or institution) that provides the data of the station.

station

character. The name of the (hydro)-meteorological station.

lat

numeric. Latitude of the station.

long

numeric. Longitude of the station

alt

numeric. Altitute of the station.

country

character. Country where the station is located. Argentina is set as default value.

province

character. Name of the province where the station is located. Mendoza is set as default value.

river

character. Basin river's name.

active

logical. It indicates whether or not the station is currently operated. Default value is TRUE.

basin_area

numeric. The basin area (km2) of the catchment upstream of the gauge.

basin_eff

numeric. The effective area (km2) of the basin upstream of the gauge. In Canada, many basins have variable contributing fractions. In these basins, the effective area of the basin contributes flow to the outlet at least one year in two.

other_1

ANY. It is the first free-to-fill slot in order to give you the chance to write extra information about your hydro-met station.

other_2

ANY. It is the second free-to-fill slot in order to give you the chance to write extra information about your hydro-met station.

...

arguments to be passed to methods. They rely on the slots of the obj subclass.

hq

water-height vs stream-discharge measurements.

hw

water level records.

qh

hourly mean river discharge.

qd

daily mean river discharge.

qa

annual river discharge.

qm

monthly mean river discharge.

wspd

wind speed.

wdir

wind direction.

evap

pan-evaporation.

anem

anemometer wind speed records (usually installed above the pan-evap tank).

patm

atmospheric pressure.

rh

relative humidity.

tair

air temperature (typically recorded at hourly time-step).

tmax

daily maximum recorded air temperature.

tmin

daily minimum recorded air temperature.

tmean

daily mean air temperature.

tsoil

soil temperature.

precip

total (snow and rain) precipitation records.

rainfall

liquid only precipitation measurements.

swe

snow water equivalent (typically recorded on snow pillows).

hsnow

snow height from ultrasonic devices.

kin

incoming short-wave radiation.

kout

outgoing short-wave radiation.

lin

incoming long-wave radiation.

lout

outgoing long-wave radiation.

unvar

reserved for non-considered variables.

compact

data frame with Date as first column. All other columns are hydro-meteorological variables.

Value

The hydromet object with the slots set.

Functions

  • hm_set(hydromet): set method for generic object

  • hm_set(hydromet_station): set method for station object

  • hm_set(hydromet_compact): set method for compact object

Examples

## Not run: 
# create an hydro-met station
hm_guido <- hm_create(class_name = 'station')

# assign altitude
hm_guido <- hm_set(obj = hm_guido, alt = 2480)

# now we read streamflow - water height measurements
path_file <- system.file('extdata', 'snih_hq_guido.xlsx',
package = 'hydrotoolbox')
guido_hq  <- read_snih(path = path_file, by = 'none',
             out_name = c('h(m)', 'q(m3/s)',
                            'q_coarse_solid(kg/s)',
                            'q_fine_solid(kg/s)') )

# set the new data frame
 # note: you can do it manually but using the hm_build() method
 #       is stromgly recommended
hm_guido <- hm_set(obj = hm_guido, hq = guido_hq)
hm_show(obj = hm_guido)

## End(Not run)


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