[Stable]

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

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()
#> Error in UseMethod("run_id"): no applicable method for 'run_id' applied to an object of class "NULL"

identical(
  m_all %>% subset(run_id(m_all) %in% "m1"),
  m1
)
#> Error in subset(., run_id(m_all) %in% "m1"): object 'm_all' not found