as.character

0th

Percentile

Character representation of a Raster or Extent object

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.

Keywords
methods, spatial
Usage
# S4 method for Raster
as.character(x, ...)
# S4 method for Extent
as.character(x, ...)
Arguments
x

Raster* or Extent object

...

additional arguments, none implemented

Value

character

Aliases
  • as.character
  • as.character,Raster-method
  • as.character,Extent-method
Examples
# NOT RUN {
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))
# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.