read_assessment()
View source ↗On this page
Read a fit saved with save_assessment(); the result can be summarized, extracted and plotted without refitting.
Usage
read_assessment(file)
Arguments
| Argument | Default | Description |
|---|---|---|
file | required | An RDS file written by |
Value
A fit of class alscl_fit with its stored inputs, settings and estimates and without the TMB object (obj).
Details
The function checks the format and schema version of the file. Summaries, extractors and the plots that use the report work on the result; refit_model() fits the model again when a TMB object is needed.
Examples
Run the setup before the example. Fitting examples require an R-compatible C++ toolchain; simulation and export examples may write files.
Example setup
library(ALSCL)
library(ggplot2)
library(patchwork)
data("YTF_example")
x <- YTF_example
inputs <- x[c("data.CatL", "data.wgt", "data.mat")]
dat <- x$data.CatL
a <- run_acl(x, silent = TRUE)
b <- run_alscl(x, silent = TRUE)
path <- tempfile(fileext = ".rds")
save_assessment(a, path)
saved <- read_assessment(path)
plot_SSB(saved)