[R-sig-Geo] sp 1.0-0 package: sp.polygons in levelplot behaviour

Jonathan j2kennel at gmail.com
Fri Oct 5 04:58:46 CEST 2012


Hello all, 

I updated my version of sp to 1.0-0 today and am getting a different
behaviour when using levelplot and sp.polygons.  The polygons do not appear
to be terminating when I run the following code.  Anyone else have this
problem?  It does seem to work if I use spplot though.  I have previous code
that uses lattice::levelplot and rasterVis::levelplot which I can modify to
spplot but would rather not have to.

library(sp)
library(maptools)
library(lattice)
library(raster)
library(rasterVis)

nc <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1],
proj4string=CRS("+proj=longlat +datum=NAD27"))
r <- raster(nc)
r[] <- 1
levelplot(r,
              panel = function(x,y,z,col.regions,subscripts,region,...){
                 panel.levelplot.raster(x, y, z, subscripts=subscripts)
                 sp.polygons(nc)
               }
)


Thank you,
Jonathan

sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C              
LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8    
LC_MONETARY=en_CA.UTF-8   
 [6] LC_MESSAGES=en_CA.UTF-8    LC_PAPER=C                 LC_NAME=C                 
LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] rasterVis_0.11-01   hexbin_1.26.0       latticeExtra_0.6-24
RColorBrewer_1.0-5  raster_2.0-12       maptools_0.8-16     lattice_0.20-10    
[8] foreign_0.8-50      sp_1.0-0           

loaded via a namespace (and not attached):
[1] tools_2.15.1 zoo_1.7-7   



--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/sp-1-0-0-package-sp-polygons-in-levelplot-behaviour-tp7581148.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list