Description Usage Arguments Value Author(s) See Also Examples
Create pie charts data in form of SpatialPolygonsDataFrame depending on few attributes.
1 2 3 4 5 6 |
SPDF |
object of SpatialPointsDataFrame-class with associated coordinate reference systems |
zcol |
variable column names, or column numbers after removing spatial coordinates from x@data: 1 refers to the first non-coordinate column |
scalelist |
if TRUE circles are different in size, FALSE all circles have same radius |
max.radius |
value for maximum radius in meter |
do.sqrt |
logical; if TRUE the plotting symbol area (sqrt(diameter)) is proportional to the value of the z-variable; if FALSE, the symbol size (diameter) is proportional to the z-variable |
The function provide SpatialPolygonsDataFrame depending on few attributes, ready to use for plotGoogleMaps or spplot.
Milan Kilibarda kili@grf.bg.ac.rs
pieSP, elSPDF, bubbleSP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Data preparation
data(meuse)
coordinates(meuse)<-~x+y
proj4string(meuse) <- CRS('+init=epsg:28992')
pies<-pieSP(meuse,zcol=c('zinc','lead','copper'), max.radius=120)
pies$pie=rep(c('zinc','lead','copper'),155)
m=plotGoogleMaps(pies, zcol='pie')
pies$pie2=rep(1:3,155)
spplot(pies, 'pie2')
pies2<-pieSP(meuse,zcol=c('zinc','dist.m'), max.radius=70,scalelist=FALSE)
pies2$pie=rep(c('zinc','dist.m'),155)
m=plotGoogleMaps(pies2, zcol='pie')
# plotKML(pies, col='pie')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.