Skip to content
Prev 10877 / 29559 Next

Maptools as.SpatialPolygons.owin() behaves in a strange way ?

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