diff --git a/import/import-guide.md b/import/import-guide.md index 29cb811..e11dd44 100644 --- a/import/import-guide.md +++ b/import/import-guide.md @@ -6,7 +6,7 @@ Initial version of the codebook was created by Phillip Hocks and Jan Fischer (University of Bremen) in 2015. This work was funded by a small research grant of the University of Bremen (M8 Plus). -More information: [partyfacts.herokuapp.com](http://www.partyfacts.org) -- +More information: [partyfacts.org](http://www.partyfacts.org) -- [github.com/hdigital/partyfactsdata](https://github.com/hdigital/partyfactsdata) diff --git a/import/readme.md b/import/readme.md index 809689d..f7dae2a 100644 --- a/import/readme.md +++ b/import/readme.md @@ -13,9 +13,9 @@ For a detailed instruction how to contribute your dataset, see [our import guide # R packages and snippets -Most of the data preparation is done in R. Some scripts may require additional packages. We have a strong preference for [RStudio R packages](https://www.rstudio.com/products/rpackages/) (esp. [tidyverse](http://tidyverse.org/)). `run-all.R` includes information about used packages. +Most of the data preparation is done in R. Some scripts may require additional packages. We have a strong preference for [RStudio R packages](https://www.rstudio.com/products/rpackages/) (esp. [tidyverse](https://tidyverse.org/)). `run-all.R` includes information about used packages. -Please use the [tidyverse R Style Guide](http://style.tidyverse.org/) when writing code in R. +Please use the [tidyverse R Style Guide](https://style.tidyverse.org/) when writing code in R. Party Facts import requires ISO3 country codes. `country.csv` includes the respective information. Recode country names with the R-package `countrycode` @@ -23,7 +23,7 @@ Party Facts import requires ISO3 country codes. `country.csv` includes the respe # Example country recoding from Marpor import marpor <- marpor %>% mutate(country = countrycode(countryname, "country.name", "iso3c", - custom_match = c(`Northern Ireland`="NIR"))) + custom_match = c(`Northern Ireland` = "NIR"))) if(any(is.na(marpor$country))) { warning("Country name clean-up needed") } diff --git a/import/run-all.R b/import/run-all.R index 6621a3c..670288c 100644 --- a/import/run-all.R +++ b/import/run-all.R @@ -1,13 +1,12 @@ # install and load all required packages -packages <- c("tidyverse", "countrycode", "RCurl") +packages <- c("tidyverse", "countrycode", "RCurl", "haven", "dbplyr") lapply(packages, function(pack) { if ( ! pack %in% installed.packages()[,"Package"]) { - install.packages(pack, repos="http://cran.r-project.org") + install.packages(pack, repos = "https://cran.r-project.org") } - require(pack, character.only=TRUE, quietly=TRUE) + require(pack, character.only = TRUE, quietly = TRUE) }) -update.packages(ask=FALSE) # run import scripts in all sub-folders