Learn R Programming

RStoolbox (version 0.1.1)

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

Description

Fortify method for classes from the raster package.

Usage

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

## S3 method for class 'RasterBrick': fortify(...)

## S3 method for class '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
library(ggplot2)
data(rlogo)
r_df <- fortify(rlogo)
head(r_df)

Run the code above in your browser using DataLab