powered by
Fortify method for classes from the terra package.
fortifySpatRaster(x, maxpixels = 50000)
Returns a data.frame with coordinates (x,y) and corresponding raster values.
SpatRaster object to convert into a dataframe.
SpatRaster
Integer. Maximum number of pixels to sample
r_df <- fortifySpatRaster(rlogo) head(r_df)
Run the code above in your browser using DataLab