\HeaderA{polygons}{sets spatial coordinates to create spatial data, or retrieves
spatial coordinates}{polygons}
\aliasA{polygons<\Rdash}{polygons}{polygons<.Rdash.}
\keyword{manip}{polygons}
\begin{Description}\relax
sets spatial coordinates to create spatial data, or retrieves
spatial coordinates
\end{Description}
\begin{Usage}
\begin{verbatim}
        polygons(obj)
        polygons(object) <- value
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{obj}] object of class "SpatialPolygonsDataFrame" 
\item[\code{object}] object of class "data.frame" 
\item[\code{value}] object of class "SpatialPolygons" 
\end{ldescription}
\end{Arguments}
\begin{Value}
polygons returns the SpatialPolygons of obj; polygons<- promotes a
data.frame to a SpatialPolygonsDataFrame object
\end{Value}
\begin{Examples}
\begin{ExampleCode}
data(ncshp)
nc1 <- as.SpatialPolygons.Shapes(nc.shp$Shapes, as.character(nc.shp$att.data$FIPS))
df <- nc.shp$att.data
rownames(df) <- df$FIPS
polygons(df) <- nc1
class(df)
\end{ExampleCode}
\end{Examples}

