simple_field: Interface for getting and setting your own simple fields in...

View source: R/nm-gettersetters.R

simple_fieldR Documentation

Interface for getting and setting your own simple fields in nm objects

Description

[Stable]

Usage

simple_field(m, ...)

Arguments

m

An nm object.

...

Arguments to get/set fields.

Value

If ... contains an assignment, an nm object with modified field, otherwise returns the field value.

Examples


# create example object m1 from package demo files
exdir <- system.file("extdata", "examples", "theopp", package = "NMproject")
m1 <- new_nm(run_id = "m1", 
             based_on = file.path(exdir, "Models", "ADVAN2.mod"),
             data_path = file.path(exdir, "SourceData", "THEOPP.csv"))

m1 <- m1 %>% simple_field(stars = 3)
m1 %>% simple_field(stars)
m1 ## see that stars is a field of the nm object.


tsahota/NMproject documentation built on Oct. 1, 2022, 11:51 a.m.