\HeaderA{SpatialPixelsDataFrame-class}{Class "SpatialPixelsDataFrame" ~~~}{SpatialPixelsDataFrame.Rdash.class}
\aliasA{\$.SpatialPixelsDataFrame}{SpatialPixelsDataFrame-class}{.Rdol..SpatialPixelsDataFrame}
\aliasA{\$<\Rdash.SpatialPixelsDataFrame}{SpatialPixelsDataFrame-class}{.Rdol.<.Rdash..SpatialPixelsDataFrame}
\aliasA{as.data.frame.SpatialPixelsDataFrame}{SpatialPixelsDataFrame-class}{as.data.frame.SpatialPixelsDataFrame}
\aliasA{coerce,SpatialPixelsDataFrame,AttributeList-method}{SpatialPixelsDataFrame-class}{coerce,SpatialPixelsDataFrame,AttributeList.Rdash.method}
\aliasA{coerce,SpatialPixelsDataFrame,data.frame-method}{SpatialPixelsDataFrame-class}{coerce,SpatialPixelsDataFrame,data.frame.Rdash.method}
\aliasA{coerce,SpatialPixelsDataFrame,matrix-method}{SpatialPixelsDataFrame-class}{coerce,SpatialPixelsDataFrame,matrix.Rdash.method}
\aliasA{coerce,SpatialPixelsDataFrame,SpatialGridDataFrame-method}{SpatialPixelsDataFrame-class}{coerce,SpatialPixelsDataFrame,SpatialGridDataFrame.Rdash.method}
\aliasA{coerce,SpatialPixelsDataFrame,SpatialPointsDataFrame-method}{SpatialPixelsDataFrame-class}{coerce,SpatialPixelsDataFrame,SpatialPointsDataFrame.Rdash.method}
\aliasA{plot.SpatialPixelsDataFrame}{SpatialPixelsDataFrame-class}{plot.SpatialPixelsDataFrame}
\aliasA{print.summary.SpatialPixelsDataFrame}{SpatialPixelsDataFrame-class}{print.summary.SpatialPixelsDataFrame}
\aliasA{summary.SpatialPixelsDataFrame}{SpatialPixelsDataFrame-class}{summary.SpatialPixelsDataFrame}
\aliasA{[,SpatialPixelsDataFrame-method}{SpatialPixelsDataFrame-class}{[,SpatialPixelsDataFrame.Rdash.method}
\aliasA{[[,SpatialPixelsDataFrame-method}{SpatialPixelsDataFrame-class}{[[,SpatialPixelsDataFrame.Rdash.method}
\aliasA{[[<-,SpatialPixelsDataFrame-method}{SpatialPixelsDataFrame-class}{[[<.Rdash.,SpatialPixelsDataFrame.Rdash.method}
\keyword{classes}{SpatialPixelsDataFrame-class}
\begin{Description}\relax
Class for spatial attributes that have spatial locations
on a regular grid.
\end{Description}
\begin{Section}{Objects from the Class}
Objects can be created by calls of the form \code{as(x,
"SpatialPixelsDataFrame")}, where \code{x} is of class
\LinkA{SpatialPointsDataFrame-class}{SpatialPointsDataFrame.Rdash.class}, or by importing through rgdal.  
Ordered full grids are stored instead or unordered non-NA cells;
\end{Section}
\begin{Section}{Slots}
\describe{
\item[\code{bbox}:] Object of class \code{"matrix"}; bounding box 
\item[\code{proj4string}:] Object of class \code{"CRS"}; projection 
\item[\code{grid}:] see \LinkA{GridTopology-class}{GridTopology.Rdash.class}; grid parameters 
\item[\code{grid.index}:] integer; index of points in the list to points
in the full (ordered) grid. x cycles fastest; all coordinates increase
from low to hight except y, which decreases from high to low 
\item[\code{data}:] Object of class \LinkA{AttributeList-class}{AttributeList.Rdash.class}
containing the attribute data 
}
\end{Section}
\begin{Section}{Extends}
Class \code{"SpatialPixels"}, directly.
Class \code{"Spatial"}, by class \code{"SpatialPixels"}.
\end{Section}
\begin{Section}{Methods}
\describe{
\item[coordinates] \code{signature(x = "SpatialPixelsDataFrame")}: retrieves (and calculates!) coordinates 
\item[[] \code{signature(x = "SpatialPixelsDataFrame")}: selects row(s) and/or attribute(s), and returns an
object of class \code{SpatialPixelsDataFrame}; rows refer here to the pixel
numbers, not grid lines. For selecting a square block in a grid, coerce to
a \LinkA{SpatialGridDataFrame-class}{SpatialGridDataFrame.Rdash.class} first, and use \code{[} on that object
\item[[[] \code{signature(x = "SpatialPixelsDataFrame")}: retrieves an attribute, dropping everything 
else (topology) 
\item[[[<-] \code{signature(x = "SpatialPixelsDataFrame")}: assigns or replaces an attribute 
\item[as.matrix] \code{signature(x = "SpatialPixelsDataFrame")}: coerce to matrix 
}
\end{Section}
\begin{Note}\relax
\end{Note}
\begin{Author}\relax
Edzer J. Pebesma, \email{e.pebesma@geo.uu.nl}
\end{Author}
\begin{References}\relax
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{SpatialPixels-class}{SpatialPixels.Rdash.class}}, which does not contain the attribute data
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(meuse.grid) # only the non-missing valued cells
coordinates(meuse.grid) = c("x", "y") # promote to SpatialPointsDataFrame
gridded(meuse.grid) <- TRUE # promote to SpatialPixelsDataFrame
meuse.grid[["idist"]] = 1 - meuse.grid[["dist"]] # assigns new attribute
image(meuse.grid["idist"]) # note the single [

# toy example:
df = data.frame(z = c(1:6,NA,8,9),
    xc = c(1,1,1,2,2,2,3,3,3),
    yc = c(rep(c(0, 1.5, 3),3)))
coordinates(df) = ~xc+yc
gridded(df) = TRUE
image(df["z"])
# draw labels to verify:
cc = coordinates(df)
z=df[["z"]]
zc=as.character(z)
zc[is.na(zc)]="NA"
text(cc[,1],cc[,2],zc)

\end{ExampleCode}
\end{Examples}

