Description Usage Arguments Value See Also Examples
View source: R/getDataFromRdf.R
getDataForAllScens()
gets slot data from multiple rdf files and/or multiple
scenarios, aggregates it, and saves it as a data.frame. The slot data can be
aggregated in multiple ways (see slot_agg_list).
1 2 3 4 5 6 7 8 9 | getDataForAllScens(
scenFolders,
scenNames,
slotAggList,
scenPath,
oFile = NULL,
retFile = NULL,
findAllSlots = TRUE
)
|
scenFolders |
A string vector containing the folder names (scenarios) that the rdf files are saved in. |
scenNames |
A string vector containing the scenario names. This should
be the same length as |
slotAggList |
The slot aggregation list. Either an object of class
slot_agg_list or a "special" list with the keyword |
scenPath |
An absolute or relative path to the folder containing
|
oFile |
If not |
retFile |
Deprecated. Data are always returned invisibly. |
findAllSlots |
Boolean; if |
A data.frame returned invisibly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # get a specified set of slots and apply some aggregation method to them
# get the data from two scenarios
scenFolders <- c('ISM1988_2014,2007Dems,IG,Most',
'ISM1988_2014,2007Dems,IG,2002')
# slotAggTable.csv lists the slots to obtain, and the aggregation method to
# apply to them
slotAggList <- slot_agg_list(
system.file('extdata','SlotAggTable.csv',package = 'RWDataPlyr')
)
scenPath <- system.file('extdata','Scenario/',package = 'RWDataPlyr')
# expect Deprecated warning
testthat::expect_warning(
keyData <- getDataForAllScens(
scenFolders,
scenNames = scenFolders,
slotAggList = slotAggList,
scenPath = scenPath
)
)
# get all of the data from the KeySlots rdf file
scenFolders <- scenFolders[1] # only one scenario
slotAggList <- list(list(rdf = 'KeySlots.rdf', slots = 'all'))
# will return monthly data for all slots in KeySlots.rdf
# expect Deprecated warning
testthat::expect_warning(
allData <- getDataForAllScens(
scenFolders,
scenNames = scenFolders,
slotAggList = slotAggList,
scenPath = scenPath
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.