extract_SFSW2_cells_from_shp: Extract spatial polygon data for polygons or rectangles.

Description Usage Arguments Value See Also

View source: R/Spatial_Functions.R

Description

Extract spatial polygon data for polygons or rectangles.

Usage

1
extract_SFSW2_cells_from_shp(x, y, fields = NULL, code = NULL, ...)

Arguments

x

A object inheriting from data are extracted.

y

Either an object inheriting from sp::SpatialPolygons OR resolution(s) of rectangles as a numeric vector of length two or a matrix with two columns.

  • If sp::SpatialPolygons, then values of data are extracted per polygon and weighted by area.

  • If the latter, then coords must be provided. y is the vector or matrix representing the rectangle extents in x- and y-coordinates.

  • If a matrix, then rows must match coords.

fields

A character vector. If not NULL, then fields selects columns of the extracted object.

code

A vector. If not NULL, then the extracted data are treated as integer codes of a factor whose levels are encoded by code.

...
  • coords Cell centers (corresponding to each resolution of y) that are represented by a two-column matrix of xy-coordinates. Ignored if y is inheriting from sp::SpatialPolygons.

  • crs_data A sp::CRS object indicating the coordinate reference system (CRS) of y and coords. Ignored if y is inheriting from sp::SpatialPolygons.

  • probs A numeric vector of probabilities with values in [0, 1] at which sample quantiles are returned.

Value

A vector or matrix with length/rows corresponding to the elements of y and available columns requested by fields. If !is.null(code), then the encoded 'factor levels' are returned.

See Also

over


Burke-Lauenroth-Lab/rSFSW2 documentation built on Aug. 14, 2020, 5:20 p.m.