
Last chance! 50% off unlimited learning
Sale ends in
This method is intended for use as the main helper function for extractStData.
extractRegion(
sgdf,
extent,
type = "response",
aggfact = NULL,
mask = NULL,
aspect = F,
aspect.categories = NULL,
slope = F
)
SpatialGridDataFrame containing data to extract
raster::extent object featuring region to extract, or a SpatialPolygonsXXX object used for extracting areal data
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 )
if provided, will spatially average the data
if an sgdf is provided, the data will be masked before extraction, aggregation, and anomaly computation
TRUE to return the aspect of the surface at each location instead of the value of the surface itself
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.
TRUE to return the slope of the surface at each location instead of the value of the surface itself
a modified SpatialGridDataFrame, sgdf, with the climatology for each location accessible via attr(sgdf@data@values, 'scaled:center') if anomalies were computed