| saveFit | R Documentation |
Save a fitted model object to a series of files
saveFit(fit, file, zip = TRUE, data = .nlmixr2saveData())
## S3 method for class 'nlmixr2FitCore'
saveFit(fit, file, zip = TRUE, data = .nlmixr2saveData())
## S3 method for class 'nlmixr2FitData'
saveFit(fit, file, zip = TRUE, data = .nlmixr2saveData())
## Default S3 method:
saveFit(fit, file, zip = TRUE, data = .nlmixr2saveData())
fit |
the fitted model object |
file |
the base name of the files to save the fit to. It may include
a directory, e.g. |
zip |
Boolean indicating if the files should be zipped. |
data |
Boolean indicating whether the original dataset ( |
nothing, called for side effects
Matthew L. Fidler
if (requireNamespace("nlmixr2est", quietly=TRUE) &&
requireNamespace("nlmixr2data", quietly=TRUE) &&
requireNamespace("withr")) {
library(nlmixr2est)
library(nlmixr2data)
withr::with_tempdir({
one.cmt <- function() {
ini({
tka <- 0.45
tcl <- log(c(0, 2.7, 100))
tv <- 3.45
eta.ka ~ 0.6
eta.cl ~ 0.3
eta.v ~ 0.1
add.sd <- 0.7
})
model({
ka <- exp(tka + eta.ka)
cl <- exp(tcl + eta.cl)
v <- exp(tv + eta.v)
linCmt() ~ add(add.sd)
})
}
fit <- nlmixr2(one.cmt, theo_sd, est="focei")
saveFit(fit) # saved to fit.zip
fit2 <- loadFit(fit) # load fit.zip
if (file.exists("fit.zip")) {
unlink("fit.zip")
}
print(fit2)
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.