[R-sig-Geo] spTransform to convert projected coords into geog coord

Robin W Hunnewell rhunne at mac.com
Thu Jul 14 23:23:00 CEST 2011


Re: this previous post, sorry my fault... fn applies to Spatial* objects, not "ppp" objects - my apologies.



Date: 14 July 2011 2:50:42 PM
To: r-sig-geo at r-project.org
Subject: [R-sig-Geo] spTransform to convert projected coords into geog coord

Hello, 

I get an error when calling function 'spTransform' -- from package {rgdal}. I've used spTransform recently w/ no problem, to convert coordinates from one CRS to coords of another. Has this function been deprecated, or is there some other method?  

My code below. I'll lean in for a dope slap if I've missed something simple! 
Thanks for any help.

> summary(pp)
Planar point pattern: 18 points
Average intensity 0.0928 points per square kilometer  

Window: polygonal boundary
single connected closed polygon with 7995 vertices
enclosing rectangle: [687.8542, 719.5667]x[4886.808, 4925.33]kilometer
Window area =  193.967 square kilometer 
Unit of length: 1 kilometer 
> pp.longlat <- spTransform(pp, CRS=CRS("+proj=longlat +ellps=WGS84"))
Error in function (classes, fdef, mtable)  : 
  unable to find an inherited method for function "spTransform", for signature "ppp", "CRS"

> sessionInfo()
R version 2.13.0 (2011-04-13)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_USUTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] rgeos_0.1-4         rgdal_0.6-33        gpclib_1.5-1        maptools_0.8-6      lattice_0.19-26    
 [6] foreign_0.8-44      spatstat_1.22-3     RandomFields_2.0.45 deldir_0.0-13       mgcv_1.7-6         
[11] raster_1.8-12       sp_0.9-80          

loaded via a namespace (and not attached):
[1] grid_2.13.0        Matrix_0.999375-50 nlme_3.1-101       tools_2.13.0   
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110714/31999fdc/attachment.html>


More information about the R-sig-Geo mailing list