This function reads all variable from a NetCDF file or the output of a
libbi object.
The file can be specified as a string to the filepath, in which
case a NetCDF connection is opened, or directly as a NetCDF connection.
either a path to a NetCDF file, or a NetCDF connection created using nc_open, or a libbi object from which to read the output
vars
variables to read; if not given, all will be read
dims
factors for dimensions
model
model file or a bi_model object (if x is not a libbi object)
type
vector of types of variable to read (out of "param", "state", "noise", "obs"). This needs 'x' to be a libbi object or model to be specified
file
which file to read (if x is given as a libbi object): one of "output" (default), "init", "input", "obs"
missval.threshold
upper threshold for the likelihood
coord_dims
any coord dimensions, given as a named list of character vectors, where each element corresponds to the variable of the same name, and the character vector are the coord dimensions
vector
if TRUE, will return results as vectors, not data.frames
thin
thinning (keep only 1/thin of samples)
verbose
if TRUE, will print variables as they are read
clear_cache
if TRUE, will clear the cache and re-read the file even if cached data exists
init.to.param
logical; if TRUE, convert states to initial values