Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

SpatialGridDataFrame

define spatial grid with attribute data


Description

defines spatial grid by offset, cell size and dimensions

Usage

SpatialPixelsDataFrame(points, data, tolerance = sqrt(.Machine$double.eps), 
		proj4string = CRS(as.character(NA)), round = NULL, grid = NULL)
SpatialGridDataFrame(grid, data, proj4string = CRS(as.character(NA)))

Arguments

points

coordinates, either as numeric matrix or as object of class SpatialPoints-class

grid

grid topology; object of class GridTopology-class; for calls to SpatialPixelsDataFrame a value of NULL implies that this will be derived from the point coordinates

data

data.frame; contains the attribute (actual grid) data

tolerance

precision up to which extent points should be exactly on a grid

round

default NULL, otherwise a value passed to as the digits argument to round for setting cell size

proj4string

object of class CRS-class in the first form only used when points does not inherit from Spatial-class

Value

SpatialPixelsDataFrame returns an object of class SpatialPixelsDataFrame-class; SpatialGridDataFrame returns an object of class SpatialGridDataFrame-class.

Note

SpatialPixels stores grid topology and coordinates of the actual points, which may be in the form of a subset (set of pixels) of a full grid. To find out or change this, see fullgrid and SpatialGrid-class.

Author(s)

Edzer Pebesma

See Also

Examples

data(meuse.grid)
m = SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid)
class(m)
summary(m)

sp

Classes and Methods for Spatial Data

v1.4-5
GPL (>= 2)
Authors
Edzer Pebesma [aut, cre], Roger Bivand [aut], Barry Rowlingson [ctb], Virgilio Gomez-Rubio [ctb], Robert Hijmans [ctb], Michael Sumner [ctb], Don MacQueen [ctb], Jim Lemon [ctb], Finn Lindgren [ctb], Josh O'Brien [ctb], Joseph O'Rourke [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.