edenToRSM: edenToRSM

View source: R/edenToRSM.R

edenToRSMR Documentation

edenToRSM

Description

Coarsen eden data to match RSM mesh cells. Function extracts data are mesh cell locations and returns a SpatVector object with the result.

Usage

edenToRSM(
  data,
  mesh = vect(system.file("extdata/gis/COP_mesh", "mesh.shp", package = "RSM"), "mesh"),
  maskToEDEN = FALSE,
  func = mean
)

Arguments

data

Input data, either SpatRaster or eden class.

mesh

Geometry used for output. A SpatVector with mesh cells.

maskToEDEN

Should data be masked to the EDEN domain? If FALSE the entire mesh is returned, including cells outside EDEN grid. If TRUE, mesh is masked to EDEN grid.

func

Function to apply when multiple EDEN cells are within a mesh cell. Typically, a measure of central tendency.

Value

Depending on the class of the input data, either a SpatVector or an eden object (list with date and data elements)

Examples


## Not run: 
edenDat <- fireHydro::getEDEN(returnType = 'terra', quarterly = TRUE)

eden_mesh <- edenToRSM(data = edenDat, maskToEDEN = TRUE)
plot(eden_mesh$data, ncol(eden_mesh$data), axes = FALSE, type = 'continuous')

## End(Not run)



troyhill/RSM documentation built on Aug. 23, 2022, 2:40 p.m.