Description Usage Arguments Details Value Note Author(s) See Also Examples
Function to copy objects between R environments
1 2 3 4 5 |
modelname |
a character or character vector of object names |
from.envir |
R environment currently containing the object(s) |
to.envir |
destination R environment to copy the object(s) to |
write.mod |
logical specifying if single models should be assigned or simply returned |
silent |
logical specifying whether additional confirmation should be printed to the screen |
All arguments are optional. With defaults, this function copies any nlsList models
from the FlexParamCurve working environment to the Global Environment. However, user could use
this function to move any objects between any environments.
Default behavior is to assign models to an environment if more than 1 modelname is provided but to
simply return the model from the function if only 1 modelname is given. Notes are printed to the
screen to detail any models moved or any errors encountered.
If only 1 modelname is provided, the contents of the object is returned. If more
more than 1 modelname is provided or if write.mod is FALSE then the object(s) will be assigned
to the environment and no value is returned.
The default function works by detecting the suffix .lis rather than object class, so will
only return models with this suffix, not necessarily all nlsList models if they have
different suffixes.
Stephen Oswald <steve.oswald@psu.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #transfer all nlsList models from the FlexParamCurve working environmment (FPCEnv)
#to the Global Environment. Note: unless pn.mod.compare or
#pn.modselect.step have been run, in which case this is default
#1. subset data object (only 3 individuals) to expediate model selection
subdata <- subset(posneg.data, as.numeric(row.names (posneg.data) ) < 40)
#2. run model selection in FPCEnv using pn.mod.compare. Only two models (#1 and #5)
#specified to be run here to reduce processing time. see pn.mod.compare
modseltable <- pn.mod.compare(subdata$age, subdata$mass,
subdata$id, existing = FALSE, pn.options = "myoptions", mod.subset = c(1,5)
, Envir = FlexParamCurve:::FPCEnv)
#3. retrieve models from FlexParamCurve working environmment
get.mod()
#transfer an options file called myoptions from FPCEnv to the Global Environment
#note data are forced to fit a monotonic curve in this example
modpar(logist.data$age, logist.data$mass, pn.options = "myoptions.1", force4par = TRUE,
Envir = FlexParamCurve:::FPCEnv)
get.mod(modelname = "myoptions.1", write.mod = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.