Learn R Programming

RStoolbox (version 0.2.4)

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

Description

Fortify method for classes from the raster package.

Usage

# S3 method for RasterLayer
fortify(x, maxpixels = 50000)

# S3 method for RasterBrick fortify(...)

# S3 method for RasterStack 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
# NOT RUN {
library(ggplot2)
data(rlogo)
r_df <- fortify(rlogo)
head(r_df)

# }

Run the code above in your browser using DataLab