Description Usage Arguments See Also Examples
Change values of a Raster* object to logical or integer values. With as.logical
, zero becomes FALSE
, all other values become TRUE
. With as.integer
values are truncated.
1 2 3 4 5 | ## S4 method for signature 'Raster'
as.logical(x, filename='', ...)
## S4 method for signature 'Raster'
as.integer(x, filename='', ...)
|
x |
Raster* object |
filename |
character. Output filename (optional) |
... |
additional optional arguments as for |
1 2 3 4 5 6 7 | r <- raster(nrow=10, ncol=10)
set.seed(0)
r[] <- runif(ncell(r)) * 10
r
r <- as.integer(r)
r
as.logical(r)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.