Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require(countrycode)
- # To UpperCase Country
- my.data$Land <- toupper(my.data$Land)
- #weitere Länder?
- my.data$Land[my.data$Land == "UK"] <- "GB" ##UK to GB
- #region
- region <- countrycode(my.data$Land, "iso2c", "region")
- #continent
- continent <- countrycode(my.data$Land, "iso2c", "continent")
- #ergänzen Regionen und Kontinent
- my.data <- cbind(my.data,region,continent)
- my.data <- na.omit(my.data)
- #ergänzen Anzahl Quellen per Land
- tmp <- as.data.frame(table(unlist(my.data$Land)))
- my.data.complete <- merge(my.data,tmp, by.x="Land",by.y="Var1")
- #export Tabelle
- write.csv(my.data.complete,"BASEDok.csv")
Add Comment
Please, Sign In to add comment