[R-sig-Geo] Maptools as.SpatialPolygons.owin() behaves in a strange way ?

Alexandre Villers villers.alexandre at gmail.com
Thu Feb 10 15:44:06 CET 2011


Dear list users and maptools mainteners,

I'm a bit confused by the behaviour of the function 
as.SpatialPolygons.owin()

library(spatstat)
library(maptools)

disc.test<-disc(radius=1, centre=c(0,0))
disc.sp<-as.SpatialPolygons.owin(disc.test) # <-- fails and return a 
error: could not find function "as.SpatialPolygons.owin"
disc.sp<-as(disc.test, "SpatialPolygons") # <-- works fine

On the other hand,  as.SpatialPoints.ppp(object.ppp) and as(object.ppp, 
"SpatialPoints") work fine. I haven't tested all the possibilities 
between spatstat and sp object, so I don't know if this "bug", if it is 
really one (everything seems to work fine on my PC), is widespread.
If not, I guess it was solely my Murphy's rule practise for today...


Alex

P.S.: sessionInfo()
sion 2.12.1 (2010-12-16)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United 
Kingdom.1252    LC_MONETARY=English_United Kingdom.1252 
LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252

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

other attached packages:
  [1] gpclib_1.5-1         maptools_0.7-38      foreign_0.8-41       
spatstat_1.21-4      deldir_0.0-13        mgcv_1.7-2           
rgdal_0.6-33         sp_0.9-76            effects_2.0-10
[10] colorspace_1.0-1     nnet_7.3-1           MASS_7.3-9           
ncf_1.1-3            gplots_2.8.0         caTools_1.11         
bitops_1.0-4.1       gdata_2.8.1          gtools_2.6.2
[19] scatterplot3d_0.3-31 lattice_0.19-13      svSocket_0.9-51      
TinnR_1.0.3          R2HTML_2.2           Hmisc_3.8-3          
survival_2.36-2

loaded via a namespace (and not attached):
[1] cluster_1.13.2     Matrix_0.999375-46 nlme_3.1-97        
svMisc_0.9-61      tools_2.12.1

-- 
Alexandre Villers, PhD.
Postdoc researcher
Spatial Ecology & Population Dynamics
Section of Ecology, Department of Biology
University of Turku
FIN-20014 Turku
Finland

@mail: alexandre.villers at utu.fi
phone: 00358 (0)2 333 5039
web page <http://vanha.sci.utu.fi/biologia/ekologia/villers_eng.htm>


Skype <skype:aquila06?call>


*Use open source and free softwares*
<http://cran.r-project.org/> <http://grass.itc.it/> 
<http://www.qgis.org/> <http://fr.openoffice.org/> 
<http://www.mozilla-europe.org/fr/> <http://www.mozilla-europe.org/fr/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110210/4210d867/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Skypelogo.jpg
Type: image/jpeg
Size: 5395 bytes
Desc: Skypelogo.jpg
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110210/4210d867/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rlogo.jpg
Type: image/jpeg
Size: 1753 bytes
Desc: Rlogo.jpg
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110210/4210d867/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GRASSlogo.png
Type: image/png
Size: 3277 bytes
Desc: GRASSlogo.png
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110210/4210d867/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QGIS.png
Type: image/png
Size: 4144 bytes
Desc: QGIS.png
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110210/4210d867/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OOlogo.gif
Type: image/gif
Size: 4246 bytes
Desc: OOlogo.gif
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110210/4210d867/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TBlogo.jpg
Type: image/jpeg
Size: 1385 bytes
Desc: TBlogo.jpg
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110210/4210d867/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FFlogo.jpg
Type: image/jpeg
Size: 1686 bytes
Desc: FFlogo.jpg
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110210/4210d867/attachment-0003.jpg>


More information about the R-sig-Geo mailing list