Created
October 25, 2018 12:31
-
-
Save mfmakahiya/fa86f2f0072d6192f52ebac24cc89231 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using map_data() | |
worldmap <- map_data ("world") | |
mapplot1 <- ggplot(worldmap) + | |
geom_map(data = worldmap, map = worldmap, aes(x=long, y=lat, map_id=region), col = "white", fill = "gray50") + | |
geom_scatterpie(aes(x=longitude, y=latitude, group = country, r = multiplier*6), | |
data = final_data, cols = colnames(final_data[,c(2:11)])) + | |
xlim(-20,60) + ylim(10, 75) + | |
scale_fill_brewer(palette = "Paired") + | |
geom_text(aes(x=longitude, y=latitude, group = country, label = country), data = final_data, stat = "identity", | |
position = position_dodge(width = 0.75), hjust = 1.5, #vjust = -1.5, size = 5, angle = 45, | |
check_overlap = TRUE, na.rm = FALSE, show.legend = NA, | |
inherit.aes = TRUE) + | |
labs(title = "Causes of death by country", x = "Longitude", y = "Latitude") + | |
theme(legend.position = "top") | |
mapplot1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment