vincentarelbundock / countrycode

R package: Convert country names and country codes. Assigns region descriptors.
https://vincentarelbundock.github.io/countrycode
GNU General Public License v3.0
343 stars 83 forks source link

new code: polity 5 #252

Closed vincentarelbundock closed 2 years ago

vincentarelbundock commented 4 years ago

Not sure what the differences are with 4 (if any)

https://www.systemicpeace.org/polityproject.html

NilsEnevoldsen commented 3 years ago

Here are the differences I got when I merged p5v2018.xls into countrycode_panel using keys p4n/p5n and year. (I renamed variables in p5v2018.xls as follows: p5n = ccode, p5c = scode, p5.name = country.)

As far as I can tell, no dictionary updates are necessary to support Polity5, but completely supporting Polity5 would require a few countrycode_panel updates, as seen below. Seems low priority.

I didn't try merging source Polity4 data into countrycode_panel. It's possible it doesn't map 100% cleanly either.

n country.name.en year p4n p4c p5n p5c p5.name
1 Egypt 1946 651 EGY
2 Egypt 1947 651 EGY
3 Egypt 1948 651 EGY
4 Egypt 1949 651 EGY
5 Egypt 1950 651 EGY
6 Singapore 1959 830 SIN
7 Singapore 1960 830 SIN
8 Singapore 1961 830 SIN
9 Singapore 1962 830 SIN
10 Singapore 1963 830 SIN
11 Singapore 1964 830 SIN
12 Zimbabwe 1970 552 ZIM
13 Zimbabwe 1971 552 ZIM
14 Zimbabwe 1972 552 ZIM
15 Zimbabwe 1973 552 ZIM
16 Zimbabwe 1974 552 ZIM
17 Zimbabwe 1975 552 ZIM
18 Zimbabwe 1976 552 ZIM
19 Zimbabwe 1977 552 ZIM
20 Zimbabwe 1978 552 ZIM
21 Zimbabwe 1979 552 ZIM
22 1993 529 ETI Ethiopia
23 1945 260 GFR Germany West
24 1990 260 GFR Germany West
25 1832 99 GCL Gran Colombia
26 1947 750 IND India
27 1948 750 IND India
28 1949 750 IND India
29 1953 812 LAO Laos
30 1861 324 SAR Sardinia
31 2011 626 SDN Sudan-North
32 1956 616 TUN Tunisia
33 1957 616 TUN Tunisia
34 1958 616 TUN Tunisia
35 1776 2 USA United States
36 1777 2 USA United States
37 1778 2 USA United States
38 1779 2 USA United States
39 1780 2 USA United States
40 1781 2 USA United States
41 1782 2 USA United States
42 1783 2 USA United States
43 1784 2 USA United States
44 1785 2 USA United States
45 1786 2 USA United States
46 1787 2 USA United States
47 1788 2 USA United States
48 1789 2 USA United States
49 1790 2 USA United States
50 1791 2 USA United States
51 1792 2 USA United States
52 1793 2 USA United States
53 1794 2 USA United States
54 1795 2 USA United States
55 1796 2 USA United States
56 1797 2 USA United States
57 1798 2 USA United States
58 1799 2 USA United States
59 1922 364 USR USSR
60 1976 816 DRV Vietnam North
61 1991 347 YGS Yugoslavia
vincentarelbundock commented 3 years ago

Thanks @NilsEnevoldsen that's very useful. I think I'd eventually like to include it anyway, just because people working with the data might be looking for version 5. But like you said, probably shouldn't be too stressed or rushed.

vincentarelbundock commented 3 years ago

(This is probably my political science bias, where a lot of people use Polity)

vincentarelbundock commented 2 years ago

I know the differences are minor, but it was not very costly to add. Done: 57bc2b6b501e66