set_context | R Documentation |
Set Context of a Workspace
set_context(jws, modelling_context = NULL)
jws |
a java workspace object. |
modelling_context |
a list of variables and calendars |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.