nm_list_gather: Get all nm_list objects

View source: R/nm_object.R

nm_list_gatherR Documentation

Get all nm_list objects

Description

[Stable]

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

Usage

nm_list_gather(x = .GlobalEnv, max_length = 1)

Arguments

x

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

max_length

Exclude objects with length above this.

Value

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

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"))

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. 30, 2022, 1:06 a.m.