create_HS: Constructs a 'HS' object from given input

View source: R/create_HSgrid.R

create_HSR Documentation

Constructs a HS object from given input

Description

Creates a HS from input where grid is a polygon grid representing the spatial units of runoff, and /coderunoff is a data.frame containing column 'Date', and where column names match the grid IDs.

Usage

create_HS(
  zones,
  runoff,
  unit,
  zoneID = "zoneID",
  name = "runoff_1",
  handle_negative = "zero"
)

Arguments

zones

An sf POLYGON object

runoff

a table of runoff where rows are timesteps and columns correspond to specific polygons in grid.

unit

Unit of the runoff timeseries

zoneID

Column name with unique IDs in grid.

name

Name of the runoff timeseries. If multiple runoff timeseries are added to the same HS object using add_HS, each timeseries must have a unique name, or else they are replaced.

handle_negative

How to handle egative runoff values (not supported in hydrostreamer): "zero" sets negative runoff to 0, "error" stops execution and returns an error. @inheritParams raster_to_HS

Value

Returns a HS object with columns

  • zoneID: unique ID

  • runoff_ts: a list column containing the runoff timeseries.


mkkallio/hydrostreamer documentation built on Oct. 14, 2023, 9:38 p.m.