\HeaderA{SpatialPixelsDataFrame}{define spatial grid with attribute data}{SpatialPixelsDataFrame}
\aliasA{SpatialGridDataFrame}{SpatialPixelsDataFrame}{SpatialGridDataFrame}
\keyword{spatial}{SpatialPixelsDataFrame}
\begin{Description}\relax
defines spatial grid by offset, cell size and dimensions
\end{Description}
\begin{Usage}
\begin{verbatim}
SpatialPixelsDataFrame(points, data, tolerance = 10 * .Machine$double.eps, 
                proj4string = CRS(as.character(NA)))
SpatialGridDataFrame(grid, data, proj4string = CRS(as.character(NA)))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{points}] coordinates, either as numeric matrix or as object of class
\LinkA{SpatialPoints-class}{SpatialPoints.Rdash.class} 
\item[\code{grid}] grid topology; object of class \LinkA{GridTopology-class}{GridTopology.Rdash.class} 
\item[\code{data}] data.frame; contains the attribute (actual grid) data 
\item[\code{tolerance}] precision up to which extent points should be 
exactly on a grid 
\item[\code{proj4string}] object of class \LinkA{CRS-class}{CRS.Rdash.class} in the first
form only used when \code{points} does not inherit from \LinkA{Spatial-class}{Spatial.Rdash.class}
\end{ldescription}
\end{Arguments}
\begin{Value}
SpatialPixelsDataFrame returns an object of class
\LinkA{SpatialPixelsDataFrame-class}{SpatialPixelsDataFrame.Rdash.class}; SpatialGridDataFrame returns an object
of class \LinkA{SpatialGridDataFrame-class}{SpatialGridDataFrame.Rdash.class}.
\end{Value}
\begin{Note}\relax
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 \LinkA{fullgrid}{fullgrid} and \LinkA{SpatialGrid-class}{SpatialGrid.Rdash.class}.
\end{Note}
\begin{Author}\relax
Edzer J. Pebesma
\end{Author}
\begin{References}\relax
\end{References}
\begin{SeeAlso}\relax
\LinkA{gridded}{gridded},
\LinkA{gridded<-}{gridded<.Rdash.},
\LinkA{SpatialGrid}{SpatialGrid},
\LinkA{SpatialGrid-class}{SpatialGrid.Rdash.class}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(meuse.grid)
m = SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")], data = meuse.grid)
class(m)
summary(m)
\end{ExampleCode}
\end{Examples}

