set_ts: Get/Set the (JDemetra+) time series of a SA-item

View source: R/saprocessing.R

set_tsR Documentation

Get/Set the (JDemetra+) time series of a SA-item

Description

(JDemetra+) time series contains more information than raw data, which can be manipulated with set_raw_data() and get_raw_data()

Usage

set_ts(jsap, idx, y)

get_ts(jsai)

Arguments

jsap

SAProcessing to be modified.

idx

index of the target SA-item.

y

a "full" time series (jd3-like).

jsai

a SA-item.

Examples


# Load a workspace
file <- system.file("workspaces", "workspace_test.xml", package = "rjd3workspace")
my_jws <- jws_open(file)

library("rjd3providers")
data_path <- system.file("data", "IPI_nace4.csv", package = "rjd3workspace")

ts_object <- txt_series(
    file = data_path,
    series = 1L,
    delimiter = "SEMICOLON",
    fmt.date = "dd/MM/yyyy"
)

# Select the first SA-Processing
jsap <- jws_sap(my_jws, 1L)

# Change the ts object
set_ts(jsap = jsap, idx = 1L, ts_object)

jsai1 <- jsap_sai(jsap, 1L)
jsai2 <- jsap_sai(jsap, 2L)
jsai3 <- jsap_sai(jsap, 3L)

# Get the ts object
get_ts(jsai1)
get_ts(jsai2)
get_ts(jsai3)


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