extractRegion {telefit} | R Documentation |
Extract region from a SpatialGridDataFrame
Description
This method is intended for use as the main helper function for extractStData.
Usage
extractRegion(
sgdf,
extent,
type = "response",
aggfact = NULL,
mask = NULL,
aspect = F,
aspect.categories = NULL,
slope = F
)
Arguments
sgdf |
SpatialGridDataFrame containing data to extract |
extent |
raster::extent object featuring region to extract, or a SpatialPolygonsXXX object used for extracting areal data |
type |
whether to return the raw data, anomalies (data minus temporal average at each location), standardized anomalies (anomalies divided by temporal standard deviation at each location), or spatially standardized data (data minus overall spatial average divided by spatial std. dev.; each year gets its own spatial standardization ) |
aggfact |
if provided, will spatially average the data |
mask |
if an sgdf is provided, the data will be masked before extraction, aggregation, and anomaly computation |
aspect |
TRUE to return the aspect of the surface at each location instead of the value of the surface itself |
aspect.categories |
if aspect==TRUE, this specifies the number of discrete categories to divide aspect numbers (0-360) into. NULL if the original scale (0-360) should be kept. By design, the aspect categories will be centered on north in the first category. |
slope |
TRUE to return the slope of the surface at each location instead of the value of the surface itself |
Value
a modified SpatialGridDataFrame, sgdf, with the climatology for each location accessible via attr(sgdf@data@values, 'scaled:center') if anomalies were computed