getDataForAllScens {RWDataPlyr} | R Documentation |
Get and aggregate data from an rdf file(s)
Description
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).
Usage
getDataForAllScens(
scenFolders,
scenNames,
slotAggList,
scenPath,
oFile = NULL,
retFile = NULL,
findAllSlots = TRUE
)
Arguments
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 |
Value
A data.frame returned invisibly.
See Also
Examples
# 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
)
)