Spatial data in R
Introduction
R is a language for statistical
computing. As such it has a strong capacity for storing, handling
and manipulating numerical or categorical data. R has dedicated data
structures and methods for specific kinds of data, e.g. time series
data, but, as of yet, not for spatial data. Although one could argue
that spatial data are just regular data with coordinates, life is much
easier when they are structured. A large number of packages provide spatial
statistical methods or interfaces to GIS, and many of them provide data
structures and e.g. plotting methods for spatial data. There is however
little coordination between them, and only very few provide functionality
for more than one spatial data type.
A package called sp
This web site is currently dedicated to package sp, a
package that provides classes and methods for spatial data (points,
lines, polygons, grids), and to new or existing spatial statistics R
packages that use sp, depend on sp, or will become dependent on sp,
such as maptools, rgdal, splancs, spgrass6, gstat, spgwr, ...
Why do we need a package of spatial data classes?
There are several reasons for providing this package of classes for spatial data:
- with support for a single package for spatial data, it is much easier
to go from one spatial statistics package to another. Either the packages
directly support reading and writing of data in these spatial classes,
or they have to provide exchange to and from the package. This requires
one-to-many links, which is easier to provide and maintain than
many-to-many links.
- the package provides methods (functions) for plotting,
printing and summarizing spatial objects, or combining them (e.g. overlay)
- packages with interfaces to GIS and geographic projection code
support the new classes; some of this functionality is demonstrated here. Note that this functionality is now released on CRAN, in packages rgdal, maptools, and spgrass6.
- the new package provides Lattice plots, conditioning plots, and
plot methods that combine points, lines, polygons and grids, scale bars,
north arrows etc. (see the gallery)
- the package uses S4 classes, allowing for the validation of
internal consistency
Last modified: February 05, 2007 by Roger Bivand