state: Get/set the (resource) state of a river network

View source: R/river_network.R

stateR Documentation

Get/set the (resource) state of a river network

Description

Setter and getter methods for river network state variables

Usage

## S3 method for class 'river_network'
state(x, var, history = FALSE)

## S3 replacement method for class 'river_network'
state(x, var) <- value

## S3 method for class 'river_network'
boundary(x, var)

## S3 replacement method for class 'river_network'
boundary(x, var) <- value

## S3 method for class 'river_network'
boundary_species(x)

## S3 replacement method for class 'river_network'
boundary_species(x) <- value

## S3 replacement method for class 'river_network'
site_by_species(x) <- value

## S3 method for class 'river_network'
site_by_species(x, history = FALSE)

reset_state(x, value)

reset_species(x, value)

Arguments

x

A river network

var

The state variable to extract/modify; must be one of resources, '

history

Logical; if TRUE, entire state history is returned

value

The value to update the variable with

Details

By default, setting state will save the current state in the state history, then update current state to value. Setting state to NULL erases the state variable.

boundary() returns the boundary condition of the river network, as a site by resources or site by species matrix. ⁠boundary() <-⁠ sets the boundary; it must be a site by var matrix in the same format as state.


flee-group/flume documentation built on Jan. 29, 2024, 6:44 p.m.