assign_crowncells_quantile_parallel: Assign Polygon Cells Their Quantile Value In A Raster in...

Description Usage Arguments Details Value Note

View source: R/assign_crowncells_quantile_parallel.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_parallel(r, crowns, plott = F,
  quantiles_to_keep = NULL, outpname_shp, parallel = F, nWorkers = 2)

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

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

parallel

Logical. Would you like the data to be processed in parallel? Default is False.

nWorkers

If running the code in parallel, how many workers should be used? Default is 4.

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.