add_HS: Combine 'HS' objects or add new runoff input from raster.

View source: R/add_HSgrid.R

add_HSR Documentation

Combine HS objects or add new runoff input from raster.

Description

Combines the runoff_ts columns from two HS objects, or adds new runoff timeseries from a raster. **All** geometries in HS must be present in the object to be added, or combination will not done.

Usage

add_HS(
  HS,
  from = NULL,
  rasters = NULL,
  unit = NULL,
  date = NULL,
  timestep = NULL,
  aoi = NULL,
  names = NULL
)

Arguments

HS

an existing HS object.

from

A HS object to add from. Optional.

rasters

A raster object, or a list of raster objects, or a list of URIs to files readable by raster package.

unit

Unit of the timeseries, coercable with units::set_units().

date

Date of the first layer in raster, or a vector of dates with the length of layers in raster, or a list of vectors of dates, corresponding to the dates in each raster layer.

timestep

Length of timestep in raster. Currently supporting "hour", "day", "month". Only needed if date is not a vector of dates.

aoi

Area of interest as an 'sf' polygon object, 'SpatialPolygons', or 'SpatialPolygonsDataFrame'. Optional, but recommended for all applications.

names

A name (names) for the runoff timeserie(s).

Value

Returns the input HS object with added columns in runoff_ts column.


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