rst_to_tib: Convert rasters to tibbles.

View source: R/rst_to_tib.R

rst_to_tibR Documentation

Convert rasters to tibbles.

Description

Convert rasters to tibbles.

Usage

rst_to_tib(r, var_name = "fill_var", xy_name = c("longitude", "latitude"))

Arguments

r

Raster object to be converted.

var_name

Column name for fill variable. Defaults to fill_var.

xy_name

Column names for x and y variables (in that order). Defaults to longitude and latitude.

Value

A tibble with three columns: a fill variable, longitude, and latitude.

Examples

library(raster)
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
tib <- rst_to_tib(r)
tib


seanhardison1/dream documentation built on Feb. 28, 2024, 12:36 p.m.