Learn R Programming

NMproject (version 0.6.9)

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

Description

[Stable]

Usage

simple_field(m, ...)

Value

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

Arguments

m

An nm object.

...

Arguments to get/set fields.

Examples

Run this code

# 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.

Run the code above in your browser using DataLab