as.data.table.raster: Transform raster to data.table

Description Usage Arguments Value Note Author(s) Examples

Description

Transform raster to data.table

Usage

1
2
as.data.table.raster(x, row.names = NULL, optional = FALSE, xy = TRUE,
  inmem = canProcessInMemory(x, 2), ...)

Arguments

x

Raster* object

row.names

'NULL' or character vector giving row names for data frame. Missing values are not allowed

optional

logical. If 'TRUE', setting row names and converting column names (to syntactic names: see make.names) is optional

xy

logical. If 'TRUE', also return the spatial coordinates

...

Additional arguments (none) passed to 'raster::as.data.frame'

centroids

logical. If TRUE return the centroids instead of all spatial coordinates (only relevant if xy=TRUE)

sepNA

logical. If TRUE the parts of the spatial objects are separated by lines that are NA (only if xy=TRUE and, for polygons, if centroids=FALSE

Value

returns a data.table object

Note

This has been amended to fix the blocksize parameter, which was set to 2.

Author(s)

etiennebr, from https://gist.github.com/etiennebr/9515738/download#

Examples

1
2
logo <- brick(system.file("external/rlogo.grd", package="raster"))
v <- as.data.table(logo)

ldemaz/dtraster documentation built on May 20, 2019, 6:44 p.m.