rasterToPoints: rasterToPoints

Description Usage Arguments Details See Also Examples

Description

Identical to raster::rasterToPoints if not_convertible is NA.

Usage

1
2
rasterToPoints(x, fun = NULL, spatial = FALSE, not_convertible = list(NA),
  ...)

Arguments

x

A Raster* object

fun

Function to select a subset of raster values

spatial

Logical. If TRUE, the function returns a SpatialPointsDataFrame object

not_convertible

A list of single elements, e.g., NA, 10, and of vectors of length two, e.g., c(0, 10).

...

Additional arguments. Currently only progress to specify a progress bar. "text", "window", or "" (the default, no progress bar)

Details

rasterToPoints does not convert cells with values that are contained as single values in not_convertible or that are within and including the range of min-max of the length two vectors of not_convertible.

See Also

raster::rasterToPoints which this function simplifies

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
if (requireNamespace("raster")) {
  r <- raster::raster(nrow = 5, ncol = 5)
  r[] <- 1:(raster::ncell(r))
  r[1:5] <- NA
  
  identical(rasterToPoints(r, not_convertible = NA), raster::rasterToPoints(r))
  rasterToPoints(r, not_convertible = NULL)
  rasterToPoints(r, not_convertible = 25)
  rasterToPoints(r, not_convertible = list(NA, 25, c(7.1, 20.5)))
}

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