View source: R/extract_highest_ncells.R
| extract_highest_ncells | R Documentation | 
Returns a raster with values only for the n cells with highest establishment likelihood.
extract_highest_ncells(infile, n_cells, outfile, return_rast = FALSE)
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
  | 
return_rast | 
 Logical. Should the   | 
This function returns a raster containing values for only the top n cells.
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.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.