Generate a data frame version of any raster object. Use the arguments
'cell', 'dim', 'split_date' and 'value' to control the columns that
are included in the output.
Usage
# S3 method for BasicRaster
as_tibble(x, cell = TRUE, dim = nlayers(x) > 1L,
value = TRUE, split_date = FALSE, xy = FALSE, ...)
Arguments
x
a RasterLayer, RasterStack or RasterBrick
cell
logical to include explicit cell number
dim
logical to include slice index
value
logical to return the values as a column or not
split_date
logical to split date into components
xy
logical to include the x and y centre coordinate of each cell
...
unused
Value
a data frame ('tbl_df'/'tibble' form)
Details
If the raster has only one layer, the slice index is not added. Use 'dim = FALSE' to not include
the slice index value.
# NOT RUN {#library(tabularaster)#library(tibble)#as_tibble(raster::raster(volcano))#as_tibble(raster::setZ(raster::raster(volcano), Sys.Date()), cell = TRUE)# }