nm_list_gather: Get all nm_list objects

Description Usage Arguments Value Examples

View source: R/nm_object.R

Description

[Stable]

Get all nm objects in an environment. By default this is the global workspace.

Usage

1

Arguments

x

An environment (default = .GlobalEnv) to search or data.frame with (nm_list column) or nm_list.

Value

A single nm_list object with all model objects in environment x.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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"))

m2 <- m1 %>% child("m2")

m_all <- nm_list_gather()

identical(
  m_all %>% subset(run_id(m_all) %in% "m1"),
  m1
)

NMproject documentation built on Sept. 5, 2021, 5:43 p.m.