Skip to contents

This function selects a variable by its capability name and sets the requested values at the requested dates. The units must also be supplied as a single string (heterogeneous units are not supported). These are checked against the expected unit in the code, and an error is signaled if they don't match (i.e., there is no attempt to convert units).

Usage

setvar(core, dates, var, values, unit)

Arguments

core

Hector core object

dates

Vector of dates

var

Capability string for the variable to set

values

Values to set. Must be either a single value or a vector the same length as dates.

unit

Unit string. Can be set to NA for unitless variables.

See also

Other main user interface functions: fetchvars(), get_tracking_data(), newcore(), reset(), run(), shutdown()