get_transect_search_points: Sample randomly 'N' points to initiate the search for...

Description Usage Arguments Value Examples

Description

Sample randomly N points to initiate the search for suitable gradients

Usage

1
2
3
get_transect_search_points(N, grid_mask1, mywindow = NULL,
  inhibit_dist = NULL, grid_maskNA = NULL, initfile = NA_character_,
  initwindowfile = NA_character_, seed = NULL, verbose = TRUE)

Arguments

N

An integer value. The number of search points to generate.

grid_mask1

A RasterLayer object from which cells with the value of 1 will be sampled.

mywindow

A owin of the package 'spatstat' or NULL. If inhibit_dist is not 0 or NULL, then an inihibited random point process generates points within this window or, if NULL, then one is created based on grid_mask1 and grid_maskNA.

inhibit_dist

A numeric value or NULL. The inhibition distance in meters between randomly sampled points.

grid_maskNA

A RasterLayer object whose cells with the value of NA will prevent sampling of corresponding cells in grid_mask1.

initfile

A filename (and its path) or NA. If not NA, then the generated search points are stored to disk in .rds format.

initwindowfile

A filename (and its path) or NA. If not NA and if a spatstat::owin object is created for an inhibited random sample, then the generated 'owin' object is stored to disk in .rds format.

seed

An integer value, NULL, or NA. NA will do nothing; the other two are passed to set.seed.

verbose

A logical value. If TRUE, then progress statements are printed out.

Value

A SpatialPoints object with N unique points. If a suitable initfile is provided, then the returned object is also stored to disk.

Examples

1
2
3
4
5
6
7
8
9
path_demo <- system.file("extdata", package = "ecotoner")
abutt_eg <- raster::raster(file.path(path_demo, "abutt_eg.grd"))
elev_eg <- raster::raster(file.path(path_demo, "elev_eg.grd"))

(temp <- get_transect_search_points(N = 10, grid_mask1 = abutt_eg, grid_maskNA = elev_eg))

raster::plot(elev_eg)
raster::image(raster::calc(abutt_eg, fun = function(x) ifelse(!is.na(x) & x == 1, 1, NA)), col = "black", add = TRUE)
points(temp, col = "red", lwd = 2)

dschlaep/ecotoner documentation built on May 15, 2019, 2:57 p.m.