Joseph--
if you want a SpatialPointsDataFrame, you can use PP <- gCentroid(SP,
byid=TRUE, id=XX) then glue your attribute table from SP to the spatial
points via SpatialPointsDataFrame(PP,SP@data).  If you don't have a
suitable unique id variable in SP, you can create it first.
Tom

Tom




On Tue, Aug 6, 2013 at 1:59 PM, Joseph Miller <jemiller31@gmail.com> wrote:

> Hello-
>
> In using gCentroid with a shapefile (SpatialPolygonsDataFrame) output is a
> SpatialPoints object stripped of all attribute data.  Is there a way to
> preserve some or all of the original data frame attributes when using
> gCentroid?  If not, another solution to creating center points from
> polygons but preserving their attribute data?
>
> Thanks,
> Joseph
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

