这可能是一个愿望清单的事情,不确定(即可能需要为此创建geom_pie).今天我看到了一张地图(LINK),上面有饼图.

我不想讨论饼图的优点,这更多的是我可以在ggplot中做这个练习吗?
我提供了一个下面的数据集(从我的下拉框中加载),其中包含制作纽约州地图的地图数据和一些关于各县种族百分比的纯粹数据.我将这种种族构成作为与主数据集的合并以及作为单独的数据集称为密钥.我也认为布莱恩古德里奇在关于居中县名的另一篇文章(HERE)中对我的回应将有助于这个概念.
我们如何用ggplot2制作上面的地图?
数据集和没有饼图的地图:
load(url("http://dl.dropbox.com/u/61803503/nycounty.RData"))
head(ny); head(key) #view the data set from my drop box
library(ggplot2)
ggplot(ny, aes(long, lat, group=group)) + geom_polygon(colour='black', fill=NA)
# Now how can we plot a pie chart of race on each county
# (sizing of the pie would also be controllable via a size
# parameter like other `geom_` functions).
Run Code Online (Sandbox Code Playgroud)
提前感谢您的想法.
编辑:我刚看到junkcharts的另一个案例,它尖叫着这种类型的能力:

我想使用ggplot2为地图上的每个位置生成一个条形图,就像xingmowang使用基本图形和许多包一样:
http://nzprimarysectortrade.wordpress.com/2011/10/02/let-r-fly-visualizing-export-data-using-r/

这与在图中嵌入微型图有关.
目前,我能做的最好的事情是在抖动的点图中将值与点大小匹配:
require(ggplot2)
require(maps)
#Get world map info
world_map <- map_data("world")
#Creat a base plot
p <- ggplot() + coord_fixed()
#Add map to base plot
base_world <- p + geom_polygon(data=world_map,
aes(x=long,
y=lat,
group=group))
#Create example data
geo_data <- data.frame(long=c(20,20,100,100,20,20,100,100),
lat=c(0,0,0,0,0,0,0,0),
value=c(10,30,40,50,20,20,100,100),
Facet=rep(c("Facet_1", "Facet_2"), 4),
colour=rep(c("colour_1", "colour_2"), each=4))
#Creat an example plot
map_with_jitter <- base_world+geom_point(data=geo_data,
aes(x=long,
y=lat,
colour=colour,
size=value),
position="jitter",
alpha=I(0.5))
#Add faceting
map_with_jitter <- map_with_jitter + facet_wrap(~Facet)
map_with_jitter <- map_with_jitter + theme(legend.position="none")
print(map_with_jitter)
Run Code Online (Sandbox Code Playgroud)

有一个不优雅的解决方法:
subset_data <- …Run Code Online (Sandbox Code Playgroud)