Learn R Programming

rsyncrosim (version 1.2.9)

datasheetRaster: Get spatial inputs or outputs from a Scenario(s).

Description

Get spatial inputs or outputs from one or more SyncroSim scenarios.

Usage

datasheetRaster(
  ssimObject,
  datasheet,
  column = NULL,
  scenario = NULL,
  iteration = NULL,
  timestep = NULL,
  subset = NULL,
  forceElements = FALSE
)

# S4 method for character datasheetRaster( ssimObject, datasheet, column = NULL, scenario = NULL, iteration = NULL, timestep = NULL, subset = NULL, forceElements = FALSE )

# S4 method for list datasheetRaster( ssimObject, datasheet, column = NULL, scenario = NULL, iteration = NULL, timestep = NULL, subset = NULL, forceElements = FALSE )

# S4 method for SsimObject datasheetRaster( ssimObject, datasheet, column = NULL, scenario = NULL, iteration = NULL, timestep = NULL, subset = NULL, forceElements = FALSE )

# S4 method for Scenario datasheetRaster( ssimObject, datasheet, column = NULL, scenario = NULL, iteration = NULL, timestep = NULL, subset = NULL, forceElements = FALSE )

Arguments

ssimObject

SsimLibrary/Project/Scenario or list of Scenarios. If SsimLibrary/Project, then scenario argument is required.

datasheet

character string. The name of the datasheet containing the raster data.

column

character string. The name of the column in the datasheet containing the filenames for raster data. If NULL then use the first column that contains raster filenames.

scenario

character string, integer, or vector of these. The scenarios to include. Required if ssimObject is an SsimLibrary/Project, ignored if ssimObject is a list of Scenarios.

iteration

integer, character string, or vector of integer/character strings. Iteration(s) to include. If NULL then all iterations are included. If no Iteration column in the datasheet, then ignored.

timestep

integer, character string, or vector of integer/character string. Timestep(s) to include. If NULL then all timesteps are included. If no Timestep column in the datasheet, then ignored.

subset

logical expression indicating datasheet rows to return. e.g. expression(grepl("Ts0001",Filename,fixed=T)). See subset() for details.

forceElements

logical. If TRUE then returns a single raster as a RasterStack; otherwise returns a single raster as a RasterLayer directly.

Value

A RasterLayer, RasterStack or RasterBrick object. See raster package documentation for details.

Details

The names() of the returned raster stack contain metadata. For datasheets without Filename this is: paste0(<datasheet name>,".Scn",<scenario id>,".",<tif name>) For datasheets containing Filename this is: paste0(<datasheet name>,".Scn",<scenario id>,".It",<iteration>,".Ts",<timestep>)

Examples

Run this code
# NOT RUN {
## Not run as it would require a result scenario (long runtime)
datasheetRaster(myResult,
  datasheet = "OutputSpatialState",
  subset = expression(grepl("Ts0001", Filename, fixed = TRUE))
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab