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 <mspinol...@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 > mspin...@una.ac.cr > mspinol...@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@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > > _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo