Description Usage Arguments Value Examples
View source: R/rwtbl_add_rise_vars.R
rwtbl_add_rise_vars()
takes in an rwtbl and adds in the variables required
for publication in RISE. It does so by converting variables from the rwtbl
to the corresponding required object name in the RISE json format. Some
columns some are constructed from one or more variables in the rwtbl, a
few must be provided by the user (ui_vars
), and others are constructed
from attributes in the rwtbl. rwtbl_cols_for_rise
includes all of the
columns that are required in the rwtbl for this function to work properly.
1 | rwtbl_add_rise_vars(rwtbl, ui_vars)
|
rwtbl |
A tbl_df with expected columns. Likely this is output from
|
ui_vars |
User specified values (as a list) for the |
tbl with all required objects for RISE json file as column names
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ifile <- system.file(
'extdata/Scenario/ISM1988_2014,2007Dems,IG,Most',
"KeySlots.rdf",
package = "RWDataPlyr"
)
# get the tbl using RWDataPlyr
rwtbl <- RWDataPlyr::rdf_to_rwtbl2(
ifile,
scenario = "test",
keep_cols = rwtbl_cols_for_rise
)
# manually specify some parameters:
ui_vars <- list(
sourceCode = "CRSS-TestData",
modelNameSourceCode = "CRSS",
status = "Finalized Dec. 2012. To RISE v0.0.1",
modelRunDescription = "desc"
)
# get the rest of the parameters automatically
rise_tbl <- rwtbl_add_rise_vars(rwtbl, ui_vars)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.