assign_crowncells_quantile: Assign Polygon Cells Their Quantile Value In A Raster

Description Usage Arguments Details Value Note

View source: R/assign_crowncells_quantile.r

Description

Overlay a polygon shapefile on a raster, so that each cell gets assigned its quantile value calculated from all the raster values falling in that that particular polygon. Optionally, write away a polygon shapefile of the crowns where only there portions with specified quantile values are kept.

Usage

1
2
assign_crowncells_quantile(r, crowns, outpname_r, plott = F,
  quantiles_to_keep = NULL, outpname_shp)

Arguments

r

The single-layer raster object to draw values from, and that will serve as the spatial template for the output

crowns

A polygon shapefile or a SpatialPolygons(dataframe) that overlays r

outpname_r

A filename for the raster output

plott

Do you want to plot the result for each crown? Default is F

quantiles_to_keep

Integer vector with quantiles to keep in trimmed crowns output. Only considered if outpname_shp is not NULL.

outpname_shp

The output filename for trimmed polygons. These retain only the part of the polygon with quantile values inside quantiles_to_keep. If set to NULL, quantiles_to_keep is ignored and no vectorized output is written away. Default is NULL

Details

Writes away both 1) a raster file, with the same spatial attributes as r and quantile values between 0 and 100 for cells in polygons, and NA outside polygons, a and 2) a shapefile with trimmed polygons

Value

A raster file, with the same spatial attributes as r and quantile values between 0 and 100 for cells in polygons, and NA outside polygons

Note

Write a line that checks wether a polygon intersects with the raster


pieterbeck/CanHeMonR documentation built on May 25, 2019, 7:11 a.m.