get_x {mapbayr} | R Documentation |
Get content from object
Description
Helpful functions to get content from a mrgmod
object (i.e. data) or from a mapbayests
object (data
, eta
, cov
, param
, phi
).
Usage
get_data(x, ...)
## S3 method for class 'mrgmod'
get_data(x, ...)
## S3 method for class 'mapbayests'
get_data(x, ..., output = "df")
get_eta(x, ...)
## S3 method for class 'mapbayests'
get_eta(x, ..., output = NULL)
get_cov(x, ...)
## S3 method for class 'mapbayests'
get_cov(x, ..., simplify = TRUE)
get_param(x, ...)
## S3 method for class 'mapbayests'
get_param(x, ..., output = NULL, keep_ID = NULL, keep_names = NULL)
get_phi(x, ...)
## S3 method for class 'mapbayests'
get_phi(x, ...)
Arguments
x |
mapbayests object |
... |
not used |
output |
either a data.frame ("df") or a vector of numeric ("num"). Default to "num" if only one ID |
simplify |
a logical. If TRUE (the default) and only one ID, one matrix is returned instead of a list of length 1 |
keep_ID |
a logical. By default, the ID variable is dropped if one ID in data. |
keep_names |
a logical. By default, names are dropped if one parameter is requested, and output is not a data frame. |
Value
the class of the object returned depends on the function, and on their arguments. Typically, a data.frame or a vector if the output can be reduced to one line.
Examples
# From a model object (mrgmod)
mod <- exmodel(ID = 1:2, cache = FALSE, capture = "CL")
get_data(mod)
# From an estimation object (mapbayests)
est <- mapbayest(mod)
get_data(est)
get_data(est, output = "list")
get_eta(est)
get_eta(est, output = "list")
get_cov(est)
get_param(est)
get_phi(est)
[Package mapbayr version 0.10.0 Index]