manipulate_sa_item {rjdworkspace}R Documentation

Manipulate SaItems

Description

Functions to remove/replace/add a sa_item from/to a SA-Processing.

Usage

remove_sa_item(sap, pos = 1)

remove_all_sa_item(sap)

replace_sa_item(sap, pos = 1, sa_item)

add_new_sa_item(sap, sa_item)

Arguments

sap

the SA-Processing.

pos

the index of the sa_item to remove or to replace.

sa_item

sa_item object.

Value

The functions remove_sa_item(), remove_all_sa_item() and replace_sa_item() return invisibly (with invisible()) TRUE or an error. The function add_new_sa_item() returns invisibly (with invisible()) the updated SA-Item.

Examples


library("RJDemetra")

sa_x13 <- jx13(series = ipi_c_eu[, "FR"])
sa_ts <- jtramoseats(series = ipi_c_eu[, "FR"])

wk <- new_workspace()
sap1 <- new_multiprocessing(workspace = wk, name = "sap-1")
add_sa_item(workspace = wk, multiprocessing = "sap-1",
            sa_obj = sa_x13, name = "X13")
add_sa_item(workspace = wk, multiprocessing = "sap-1",
            sa_obj = sa_ts, name = "TramoSeats")

sa_item1 <- get_object(x = sap1, pos = 1L)

remove_sa_item(sap = sap1, pos = 1L) # Remove the first sa-item
add_new_sa_item(sap = sap1, sa_item = sa_item1) # Add the sa-item at the end

# To replace the first sa_item by "sa_item1"
replace_sa_item(sap = sap1, pos = 1L, sa_item = sa_item1)

[Package rjdworkspace version 1.1.7 Index]