rast_to_df: Converts raster with variable to data.frame

View source: R/utility.R

rast_to_dfR Documentation

Converts raster with variable to data.frame

Description

Assumes that the name of the raster layer is the name of the variable if static is true, otherwise, the user must supply the correct variable name. If static is false, the name of the raster layer is assumed to be the time variable.

Usage

rast_to_df(rast, static = TRUE, varname = NULL)

Arguments

rast

SpatRaster

static

True if no temporal dimension, False else.

varname

The variable name, only required if static is False.

Value

data.frame

Examples

ne <- gen_naturalearth_cover()
rast_to_df(ne)

prio-data/priogrid documentation built on June 14, 2025, 11:06 p.m.