extract_highest_ncells: Returns a raster with values for the n cells with highest...

View source: R/extract_highest_ncells.R

extract_highest_ncellsR Documentation

Returns a raster with values for the n cells with highest establishment likelihood

Description

Returns a raster with values only for the n cells with highest establishment likelihood.

Usage

extract_highest_ncells(infile, n_cells, outfile, return_rast = FALSE)

Arguments

infile

File path to a raster containing estimated likelihoods of establishment or arrival.

n_cells

Integer. The number of cells to return.

outfile

Character. Output raster file path. If not provided, the RasterLayer will be returned to R.

return_rast

Logical. Should the RasterLayer be returned to R? Ignored if outfile is not provided.

Details

This function returns a raster containing values for only the top n cells.

Value

If outfile is specified, the resulting RasterLayer is saved as to that path. If return_rast is TRUE or outfile is not specified, the resulting RasterLayer is returned, otherwise NULL is returned invisibly.

Warning

This function uses the quantile approach for determining the top n cells. As such, if risk is highly aggregated this function may run into issues when n_cells is high.


jscamac/edmaps documentation built on June 11, 2022, 1:26 a.m.