Skip to content

Commit

Permalink
fix CLEA country issue (SML)
Browse files Browse the repository at this point in the history
  • Loading branch information
hdigital committed Nov 10, 2018
1 parent dc82af5 commit 33dfc15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion import/clea/clea.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ party <- party %>%
inner_join(vote)

# add Party Facts country codes
country_short_custom <- c(Kosovo = "XKX", Somaliland = "SML", Zambia = "ZMB")
party <- party %>%
mutate(country = countrycode(ctr_n, "country.name", "iso3c",
custom_match = c(Kosovo = "XKX", Zambia = "ZMB")))
custom_match = country_short_custom))
if(any(is.na(party$country)) | ! all(vote$ctr_n %in% party$ctr_n)) {
warning("Country name clean-up needed")
}
Expand Down
6 changes: 3 additions & 3 deletions import/clea/clea.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1922,9 +1922,9 @@
"1921","Solomon Islands",35,,"Solomons Social Credit Party",,,90,"Solomons Social Credit Party",2006,2006,4.3,2006,1,90000035,"SLB"
"1922","Solomon Islands",36,,"United Democratic Party",,,90,"United Democratic Party",2014,2014,10.7,2014,1,90000036,"SLB"
"1923","Solomon Islands",37,,"United Party",,,90,"United Party",1980,2006,21.2,1984,5,90000037,"SLB"
"1924","Somaliland",1,,"Ururka Caddaalada Iyo Daryeelka","For Justice and Development",,1003,"For Justice and Development",2005,2005,39,2005,1,1003000001,"SOM"
"1925","Somaliland",2,,"Ururka Dimuqraadiga Ummadda Bahawday","For Unity, Democracy, and Independence",,1003,"For Unity, Democracy, and Independence",2005,2005,26.9,2005,1,1003000002,"SOM"
"1926","Somaliland",3,,"Kulmiye Nabad, Midnimo Iyo Horumar Iyo","Peace, Unity, and Development Party",,1003,"Peace, Unity, and Development Party",2005,2005,34.1,2005,1,1003000003,"SOM"
"1924","Somaliland",1,,"Ururka Caddaalada Iyo Daryeelka","For Justice and Development",,1003,"For Justice and Development",2005,2005,39,2005,1,1003000001,"SML"
"1925","Somaliland",2,,"Ururka Dimuqraadiga Ummadda Bahawday","For Unity, Democracy, and Independence",,1003,"For Unity, Democracy, and Independence",2005,2005,26.9,2005,1,1003000002,"SML"
"1926","Somaliland",3,,"Kulmiye Nabad, Midnimo Iyo Horumar Iyo","Peace, Unity, and Development Party",,1003,"Peace, Unity, and Development Party",2005,2005,34.1,2005,1,1003000003,"SML"
"1927","South Africa",7,"COPE","Congress of the People",,,710,"congress of the people",2009,2014,7.4,2009,2,710000007,"ZAF"
"1928","South Africa",8,"DA","Democratic Alliance",,,710,"democratic alliance",2004,2014,22.2,2014,3,710000008,"ZAF"
"1929","South Africa",12,"IFP","Inkatha Freedom Party",,,710,"inthaka freedom party",1994,2014,10.5,1994,5,710000012,"ZAF"
Expand Down

0 comments on commit 33dfc15

Please sign in to comment.