# 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, now including 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.

## A package called sp

This web site is based on 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 or depend on sp, such as splancs, spgrass6, 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
- the 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 21, 2011 by Roger Bivand