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

Description Usage Arguments Value Functions Examples

Description

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

Usage

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
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,
  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,
  lin = 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.

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.

lin

incoming 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

Examples

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

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