Learn R Programming

RStoolbox (version 1.0.0)

fortifySpatRaster: Fortify method for classes from the terra package.

Description

Fortify method for classes from the terra package.

Usage

fortifySpatRaster(x, maxpixels = 50000)

Value

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

Arguments

x

SpatRaster object to convert into a dataframe.

maxpixels

Integer. Maximum number of pixels to sample

Examples

Run this code
r_df <- fortifySpatRaster(rlogo)
head(r_df)

Run the code above in your browser using DataLab