as.character | R Documentation |
as.character
returns a text (R code) representation of a Raster* or Extent object. The main purpose of this is to allow quick generation of objects to use in examples on, for example, stackoverflow.com.
## S4 method for signature 'Raster'
as.character(x, ...)
## S4 method for signature 'Extent'
as.character(x, ...)
x |
Raster* or Extent object |
... |
additional arguments, none implemented |
character
r <- raster(ncol=3, nrow=3)
values(r) <- 1:ncell(r)
as.character(r)
s <- stack(r, r)
as.character(s)
as.character(extent(s))
x <- as.character(s)
eval(parse(text=x))
y <- as.character(extent(s))
eval(parse(text=y))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.