Description Usage Arguments Details See Also Examples
Identical to raster::rasterToPoints
if not_convertible
is NA
.
1 2 |
x |
A Raster* object |
fun |
Function to select a subset of raster values |
spatial |
Logical. If |
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 |
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.
raster::rasterToPoints
which this function simplifies
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)))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.