[R-sig-Geo] Click issue segmentGoogleMaps ( pie for plotGoogleMaps, spplot and plotKML)

Milan Kilibarda milan.kili11 at gmail.com
Fri Mar 8 20:54:45 CET 2013


 Hi,

 This is the bug in segment function,at the moment, infoWindow
 works only for 3 variables. I'm sending to you alternative solution.
 I'll fix it in new version of package. There will be fixed version of
 segmentGoogleMaps, and added pie function which can be used for
 spplot and plotKML.

 library('plotGoogleMaps')
 data(meuse)
 coordinates(meuse)<-~x+y
 proj4string(meuse) <- CRS('+init=epsg:28992')

 source('pie.R')

 a=pie(meuse,zcol=c('zinc','lead','copper'))
 a$col=rep(c('zinc','lead','copper'),155)
 m=plotGoogleMaps(a,zcol='col',colPalette=c('red','green','blue') )

 # this works for 2 or more variables.

  a=pie(meuse,zcol=c('zinc','lead','copper','dist.m'))
  a$col=rep(c('zinc','lead','copper','dist.m'),155)
  m=plotGoogleMaps(a,zcol='col',colPalette=rainbow(4) )

 # you can use it for spplot
  a$col=rep(1:4,155)
  spplot(a,zcol='col', col.regions=rainbow(4))

 # or for plotKML
 plotKML(a)

 Hope this helps.

 Best,
 Kili
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pie.R
Type: application/octet-stream
Size: 5047 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130308/2da96ae2/attachment.obj>


More information about the R-sig-Geo mailing list