Description Usage Arguments Value See Also Examples
Creates item definitions from a model name. Scavenges definitions optionally from the control stream and optionally from the definitions file. Optionally writes the result to the definitions file. Always returns a data.frame with at least the column 'item' but possibly no rows.
1 2 3 4 5 6 7 | ## S3 method for class 'modelname'
as.definitions(x, verbose = FALSE,
opt = getOption("project"), project = if (is.null(opt)) getwd() else opt,
rundir = file.path(project, x), ctlfile = file.path(rundir, paste0(x,
".ctl")), metafile = file.path(rundir, paste0(x, ".def")),
fields = c("symbol", "label", "unit"), read = length(metafile) == 1,
write = FALSE, ...)
|
x |
a model name (numeric or character) |
verbose |
set FALSE to suppress messages |
opt |
alternative argument for setting project |
project |
parent directory of model directories |
rundir |
specific model directory |
ctlfile |
path to control stream (pass length-zero argument to ignore) |
metafile |
path to definitions file (pass length-zero argument to ignore) |
fields |
metadata fields to read from control stream if no metafile |
read |
whether to read the definitions file |
write |
whether to write the definitions file |
... |
passed to other functions |
object of class definitions, or path to metafile if write = TRUE.
1 2 3 | library(magrittr)
options(project = system.file('project/model',package='partab'))
1001 %>% as.definitions
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.