set_context: Set Context of a Workspace

View source: R/workspace.R

set_contextR Documentation

Set Context of a Workspace

Description

Set Context of a Workspace

Usage

set_context(jws, modelling_context = NULL)

Arguments

jws

a java workspace object.

modelling_context

a list of variables and calendars

Examples



library("rjd3toolkit")

# French calendar
french_calendar <- national_calendar(
    days = list(
        fixed_day(7, 14), # Bastille Day
        fixed_day(5, 8, validity = list(start = "1982-05-08")), # End of 2nd WW
        special_day("NEWYEAR"),
        special_day("CHRISTMAS"),
        special_day("MAYDAY"),
        special_day("EASTERMONDAY"),
        special_day("ASCENSION"),
        special_day("WHITMONDAY"),
        special_day("ASSUMPTION"),
        special_day("ALLSAINTSDAY"),
        special_day("ARMISTICE")
    )
)

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

# Creating a new context
new_context <- modelling_context(
    calendars = list(FR = french_calendar),
    variables = list(a = AirPassengers)
)

# Set the context
set_context(jws, new_context)


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