rst_to_tib | R Documentation |
Convert rasters to tibbles.
rst_to_tib(r, var_name = "fill_var", xy_name = c("longitude", "latitude"))
r |
Raster object to be converted. |
var_name |
Column name for fill variable. Defaults to |
xy_name |
Column names for x and y variables (in that order). Defaults to |
A tibble
with three columns: a fill variable, longitude, and latitude.
library(raster)
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
tib <- rst_to_tib(r)
tib
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.