Convert from spatialpointsdataframe to spatialpoints
Manuel. Did you try it without converting? The help file in raster says it needs a SpatialPoints* object. The '*' is a wild card that in this case stands for 'DataFrame'. The answer to your question: as(x, 'SpatialPoints') You could find the answer to many of this type of questions by reading the vignettes of sp and raster, and by searching the R-sig-geo help archives, and looking at the R spatial wiki. Robert
On Thu, Nov 4, 2010 at 10:25 AM, Manuel Sp?nola <mspinola10 at gmail.com> wrote:
Dear list members, I am trying to create a raster from points, but I read the points from a shapfile, so I have the points object as a SpatialPointsDataFrame. To use the function pointsToRaster I need the points as SpatialPoints. How to convert a SpatialPointsDataFrame object to a SpatialPoints? Best, Manuel -- *Manuel Sp?nola, Ph.D.* Instituto Internacional en Conservaci?n y Manejo de Vida Silvestre Universidad Nacional Apartado 1350-3000 Heredia COSTA RICA mspinola at una.ac.cr mspinola10 at gmail.com Tel?fono: (506) 2277-3598 Fax: (506) 2237-7036 Personal website: Lobito de r?o <https://sites.google.com/site/lobitoderio/> Institutional website: ICOMVIS <http://www.icomvis.una.ac.cr/> ? ? ? ?[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo