get_model {RJDemetra} | R Documentation |
Get the seasonally adjusted model from a workspace
Description
Generic functions to retrieve seasonally adjusted model(s) from workspace
,
multiprocessing
or sa_item
object. get_model
returns a "SA"
object while get_jmodel
returns the Java objects of the models.
Usage
get_jmodel(x, workspace, userdefined = NULL, progress_bar = TRUE)
get_model(x, workspace, userdefined = NULL, progress_bar = TRUE)
Arguments
x |
the object from which to retrieve the seasonally adjusted model. |
workspace |
the workspace object where models are stored. If |
userdefined |
a vector containing the names of additional output variables.
(see |
progress_bar |
Boolean: if |
Value
get_model()
returns a seasonally adjusted object (class c("SA", "X13")
or c("SA", "TRAMO_SEATS"
) or a list of seasonally adjusted objects:
if
x
is asa_item
object,get_model(x)
returns a"SA"
object (or ajSA
object withget_jmodel(x)
);if
x
is amultiprocessing
object,get_ts(x)
returns a list of length the number of sa_items, each element containing a"SA"
object (or ajSA
object withget_jmodel(x)
);if
x
is aworkspace
object,get_ts(x)
returns list of length the number of multiprocessings, each element containing a list of"SA"
object(s) (orjSA
object's) withget_jmodel(x)
).
See Also
Other functions to retrieve information from a workspace, multiprocessing or sa_item: count
, get_name
, get_ts
.
Examples
spec_x13 <- x13_spec(spec = "RSA5c", easter.enabled = FALSE)
sa_x13 <- x13(ipi_c_eu[, "FR"], spec = spec_x13)
spec_ts <- tramoseats_spec(spec = "RSA5")
sa_ts <- tramoseats(ipi_c_eu[, "FR"], spec = spec_ts)
wk <- new_workspace()
mp <- new_multiprocessing(wk, "sap1")
add_sa_item(wk, "sap1", sa_x13, "X13")
add_sa_item(wk, "sap1", sa_ts, "TramoSeats")
compute(wk) # It's important to compute the workspace before retrieving the SA model
sa_item1 <- get_object(mp, 1)
get_model(sa_item1, wk) # To extract the model of the sa_item1: its the object sa_x13
# To get all models from the multiprocessing mp:
get_model(mp, wk)
# To get all models from the workspace wk:
get_model(wk)