I might add here:
add.pie() is a function of mapplots.
In the documentation of "mapplots" draw.pie() is the recommended function to use
Be careful if you combine the package RgoogleMaps and "mapplots". The coordinates are scaled as soon as you set a "Zoom" parameter. Here an example of an arbitrary data frame:
map1=GetBingMap(center=c(47.619048,-122.35384),zoom=15,apiKey=apiKey,
verbose=1, destfile="Seattle.png")
PlotOnStaticMap(map1)
if you add multiple pie charts on the map, this will only give you a cluster in the middle of your plot! (Note df$values is a matrix containing at least two columns corresponding the size of a slice)
library(mapplots)
draw.pie(z=df$values, x=df$lat, y=df$long, radius = 20, col=c(alpha("orange", 0.6), alpha("blue", 0.6)), labels="")
Hence you will have to rescale your pie chart coordinates first (use the map and zoom factor as above):
xy <- LatLon2XY.centered(map1,df$lat, df$long, zoom = 15)
library(mapplots)
draw.pie(z=df$values, x=xy$newX, y=xy$newY, radius = 20, col=c(alpha("orange", 0.6), alpha("blue", 0.6)), labels="")