\HeaderA{SpatialGridDataFrame-class}{Class "SpatialGridDataFrame"}{SpatialGridDataFrame.Rdash.class}
\aliasA{\$.SpatialGridDataFrame}{SpatialGridDataFrame-class}{.Rdol..SpatialGridDataFrame}
\aliasA{\$<\Rdash.SpatialGridDataFrame}{SpatialGridDataFrame-class}{.Rdol.<.Rdash..SpatialGridDataFrame}
\aliasA{as.data.frame.SpatialGridDataFrame}{SpatialGridDataFrame-class}{as.data.frame.SpatialGridDataFrame}
\aliasA{cbind.SpatialGridDataFrame}{SpatialGridDataFrame-class}{cbind.SpatialGridDataFrame}
\aliasA{coerce,SpatialGridDataFrame,AttributeList-method}{SpatialGridDataFrame-class}{coerce,SpatialGridDataFrame,AttributeList.Rdash.method}
\aliasA{coerce,SpatialGridDataFrame,data.frame-method}{SpatialGridDataFrame-class}{coerce,SpatialGridDataFrame,data.frame.Rdash.method}
\aliasA{coerce,SpatialGridDataFrame,matrix-method}{SpatialGridDataFrame-class}{coerce,SpatialGridDataFrame,matrix.Rdash.method}
\aliasA{coerce,SpatialGridDataFrame,SpatialPixelsDataFrame-method}{SpatialGridDataFrame-class}{coerce,SpatialGridDataFrame,SpatialPixelsDataFrame.Rdash.method}
\aliasA{coerce,SpatialGridDataFrame,SpatialPointsDataFrame-method}{SpatialGridDataFrame-class}{coerce,SpatialGridDataFrame,SpatialPointsDataFrame.Rdash.method}
\aliasA{plot.SpatialGridDataFrame}{SpatialGridDataFrame-class}{plot.SpatialGridDataFrame}
\aliasA{print.summary.SpatialGridDataFrame}{SpatialGridDataFrame-class}{print.summary.SpatialGridDataFrame}
\aliasA{summary.SpatialGridDataFrame}{SpatialGridDataFrame-class}{summary.SpatialGridDataFrame}
\aliasA{[,SpatialGridDataFrame-method}{SpatialGridDataFrame-class}{[,SpatialGridDataFrame.Rdash.method}
\aliasA{[[,SpatialGridDataFrame-method}{SpatialGridDataFrame-class}{[[,SpatialGridDataFrame.Rdash.method}
\aliasA{[[<-,SpatialGridDataFrame-method}{SpatialGridDataFrame-class}{[[<.Rdash.,SpatialGridDataFrame.Rdash.method}
\keyword{classes}{SpatialGridDataFrame-class}
\begin{Description}\relax
Class for spatial attributes that have spatial locations
on a (full) regular grid.
\end{Description}
\begin{Section}{Objects from the Class}
Objects can be created by calls of the form \code{as(x,
"SpatialGridDataFrame")}, where \code{x} is of class
\LinkA{SpatialPixelsDataFrame-class}{SpatialPixelsDataFrame.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{points}:] see \LinkA{SpatialPoints}{SpatialPoints}; points slot which is
not actually filled with all coordinates (only with min/max) 
\item[\code{grid}:] see \LinkA{GridTopology-class}{GridTopology.Rdash.class}; grid parameters 
\item[\code{grid.index}:] see \LinkA{SpatialPixels-class}{SpatialPixels.Rdash.class}; this slot
is of zero length for this class, as the grid is full 
\item[\code{bbox}:] Object of class \code{"matrix"}; bounding box 
\item[\code{proj4string}:] Object of class \code{"CRS"}; projection 
\item[\code{data}:] Object of class \LinkA{AttributeList-class}{AttributeList.Rdash.class},
containing attribute data 
}
\end{Section}
\begin{Section}{Extends}
Class \code{"SpatialGrid"}, directly.
Class \code{"Spatial"}, by class \code{"SpatialGrid"}.
\end{Section}
\begin{Section}{Methods}
\describe{
\item[coordinates] \code{signature(x = "SpatialGridDataFrame")}: retrieves (and calculates!) coordinates 
\item[[] \code{signature(x = "SpatialGridDataFrame")}: selects rows, columns, and attributes; returns an
object of class \code{SpatialGridDataFrame}
\item[[[] \code{signature(x = "SpatialGridDataFrame")}: retrieves an attribute, dropping everything 
else (topology) 
\item[[[<-] \code{signature(x = "SpatialGridDataFrame")}: assigns or replaces an attribute 
\item[as.matrix] \code{signature(x = "SpatialGridDataFrame")}: coerce to matrix 
\item[cbind] \code{signature(...)}: if arguments have identical topology, combine their
attribute values
}
\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{SpatialGrid-class}{SpatialGrid.Rdash.class}}, which does not contain the attribute data,
and \code{\LinkA{SpatialPixelsDataFrame-class}{SpatialPixelsDataFrame.Rdash.class} which holds possibly incomplete
  grids }
\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
x = as(meuse.grid, "SpatialGridDataFrame") # creates the full grid
x[["idist"]] = 1 - x[["dist"]] # assigns new attribute
image(x["idist"]) # note the single [ for attribute selection

# 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
df = as(df, "SpatialGridDataFrame") # to full grid
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)

# the following is weird, but illustrates the concept of row/col selection:
fullgrid(meuse.grid) = TRUE
image(meuse.grid)
image(meuse.grid[20:70, 10:70, "dist"], add = TRUE, col = bpy.colors())

\end{ExampleCode}
\end{Examples}

