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

SAProcessing to modify.

idx

index of the target SA-item.

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)
jsai <- .jsap_sai(jsap, 1)
nid <- rjd3providers::spreadsheet_change_file(.jsai_ts_metadata(jsai, "@id"), "test.xlsx")
put_ts_metadata(jsap, 1, "@id", nid)

jsai <- .jsap_sai(jsap, 1)
.jsai_ts_metadata(jsai, "@id")
#> [1] "demetra://tsprovider/XCLPRVDR/20111201/SERIES?file=test.xlsx#seriesName=European+Union&sheetName=Exports"