Learn R Programming

RStoolbox (version 0.1.6)

fortify.raster: Fortify method for classes from the raster package.

Description

Fortify method for classes from the raster package.

Usage

"fortify"(x, maxpixels = 50000)
"fortify"(...)
"fortify"(...)

Arguments

x
Raster* object to convert into a dataframe.
maxpixels
Integer. Maximum number of pixels to sample
...
not used by this method

Value

Returns a data.frame with coordinates (x,y) and corresponding raster values.

Examples

Run this code
library(ggplot2)
data(rlogo)
r_df <- fortify(rlogo)
head(r_df)

Run the code above in your browser using DataLab