Skip to content

Instantly share code, notes, and snippets.

Created July 21, 2016 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7b178737d17f97e10aa0105722dc033b to your computer and use it in GitHub Desktop.
Save anonymous/7b178737d17f97e10aa0105722dc033b to your computer and use it in GitHub Desktop.
R-code für die C1/4h über Datenvisualisierung von Karten-Daten.
rm(list = ls())
library(ggplot2)
library(dplyr)
setwd("~/Projekte/R/EU-Internet/")
d <- read.csv("./internet.csv")
View(d)
ggplot(d, aes(geo, X2013, fill = indic_is)) +
geom_bar(stat = "Identity") +
facet_wrap(~indic_is)
library(rworldmap)
world <- map_data("world") %>%
select(lon=long, lat, group, id = region)
View(world)
names <- read.csv("./countries.csv")
View(names)
d <- inner_join(d, names, by = c("geo" = "ExpCountry"))
d <- inner_join(d, world, by = c("ExpCountryCaption" = "id"))
members <- read.csv("./members_eu.csv")
View(members)
d <- inner_join(d, members, by = c("ExpCountryCaption" = "Country"))
d$X2010 = as.numeric(d$X2010)
ggplot(d, aes(lon, lat)) +
geom_polygon(aes(group = group, fill = X2010),
colour = "grey50") +
facet_wrap(~indic_is) +
coord_quickmap()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment