Skip to contents

Function to set the time series metadata of a SaItem (provider, source of the data...). set_ts_metadata() uses the metadata of another SaItem while put_ts_metadata() allows to update a specific key with a new information.

Usage

set_ts_metadata(jsap, idx, ref_jsa)

put_ts_metadata(jsap, idx, key, value)

Arguments

jsap

the SAProcessing to modify.

idx

index of the target SaItem.

ref_jsa

a reference SaItem containing the metadata.

key

key of the metadata.

value

value of the metadata.

Examples

# Change the file of a given item
file <- system.file("workspaces", "test.xml", package = "rjd3workspace")
jws <- .jws_load(file)
jsap <- .jws_sap(jws, 1)
jsa <- .jsap_sa(jsap, 1)
nid <- rjd3providers::spreadsheet_change_file(.jsa_ts_metadata(jsa, "@id"), "test.xlsx")
put_ts_metadata(jsap, 1, "@id", nid)
jsa <- .jsap_sa(jsap, 1)
.jsa_ts_metadata(jsa, "@id")
#> [1] "demetra://tsprovider/XCLPRVDR/20111201/SERIES?file=test.xlsx#seriesName=European+Union&sheetName=Exports"