Skip to content
Prev 22586 / 29559 Next

Pie charts on a map. v2

I think there are two issues:

1. You need the rworldxtra package to get the countriesHigh dataset so adding in
    library(rworldxtra) is necessary.
2. I think you need to "focus" the figure to a smaller area and add in a statement 
    like mapRegion="Somalia" in the mapPies function.

Jim


From: R-sig-Geo [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Jue Lin-Ye
Sent: Sunday, April 12, 2015 8:40 AM
To: r-sig-geo at r-project.org
Subject: [R-sig-Geo] Fwd: Pie charts on a map. v2

?
Dear sirs/madams,

May someone please help me with this issue: I have been trying to plot pie charts on a map, without much success (see code enclosed herein). This is quite distressing to me, as I had plot the same kind of map before without problems. It would be appreciated if anyone would point out the flaw. I enclose a reproducible set of data and codes for you to work with. I have tested the code, you just have to paste the three of the files in the same folder.

Thank you very much in advance. 
?