add_sa_item: Add a SA-item to a SAProcessing

View source: R/saprocessing.R

add_sa_itemR Documentation

Add a SA-item to a SAProcessing

Description

Add a SA-item to a SAProcessing

Usage

add_sa_item(jsap, name, x, spec, ...)

Arguments

jsap

SAProcessing.

name

name of the SA-item to be added.

x

either a seasonal adjustment model (from rjd3x13::x13() or rjd3tramoseats::tramoseats()), a SA-item object, "ts" object.

spec

specification to use when x is a "ts" object.

Value

NULL returned invisibly

Examples



dir <- tempdir()

# Raw series
y <- rjd3toolkit::ABS$X0.2.09.10.M

# Creating an empty workspace and SAProcessing
jws <- jws_new()
jsap1 <- jws_sap_new(jws, "sap1")

# Adding SA-item as estimation result
# Estimation with rjd313
add_sa_item(jsap1, name = "series_1", x = rjd3x13::x13(y))

# Estimation with rjd3tramoseats
add_sa_item(jsap1, name = "series_2", x = rjd3tramoseats::tramoseats(y))

# Adding SA-item as raw series + specification
add_sa_item(jsap1, name = "series_3", x = y, rjd3x13::x13_spec("RSA3"))
add_sa_item(jsap1, name = "series_4", x = y, rjd3tramoseats::tramoseats_spec("RSAFull"))
rws <- read_workspace(jws)
rws$processing$sap1$series_4

# Writing the workspace
save_workspace(jws, file.path(dir, "workspace.xml"))


palatej/rjdemetra3 documentation built on July 16, 2025, 5:41 p.m.