Gapminder\TotalPopulation.csv data …tot = fetchGapminder("Gapminder/TotalPopulation.csv")
## Retrieving from
## http://www.mosaic-web.org/go/datasets/Gapminder/TotalPopulation.csv
groupBy(tot, by = Country)
## Country count
## 1 Abkhazia 232
## 2 Afghanistan 232
## 3 Akrotiri and Dhekelia 232
## 4 Albania 232
## 5 Algeria 232
## 6 American Samoa 232
## 7 Andorra 232
## 8 Angola 232
## 9 Anguilla 232
## 10 Antigua and Barbuda 232
## 11 Argentina 232
## 12 Armenia 232
## 13 Aruba 232
## 14 Australia 232
## 15 Austria 232
## 16 Azerbaijan 232
## 17 Bahamas 232
## 18 Bahrain 232
## 19 Bangladesh 232
## 20 Barbados 232
## 21 Belarus 232
## 22 Belgium 232
## 23 Belize 232
## 24 Benin 232
## 25 Bermuda 232
## 26 Bhutan 232
## 27 Bolivia 232
## 28 Bosnia and Herzegovina 232
## 29 Botswana 232
## 30 Brazil 232
## 31 British Virgin Islands 232
## 32 Brunei 232
## 33 Bulgaria 232
## 34 Burkina Faso 232
## 35 Burundi 232
## 36 Cambodia 232
## 37 Cameroon 232
## 38 Canada 232
## 39 Cape Verde 232
## 40 Cayman Islands 232
## 41 Central African Rep. 232
## 42 Chad 232
## 43 Channel Islands 232
## 44 Chile 232
## 45 China 232
## 46 Christmas Island 232
## 47 Cocos Island 232
## 48 Colombia 232
## 49 Comoros 232
## 50 Congo, Dem. Rep. 232
## 51 Congo, Rep. 232
## 52 Cook Islands 232
## 53 Costa Rica 232
## 54 Cote d'Ivoire 232
## 55 Croatia 232
## 56 Cuba 232
## 57 Cyprus 232
## 58 Czech Rep. 232
## 59 Czechoslovakia 232
## 60 Denmark 232
## 61 Djibouti 232
## 62 Dominica 232
## 63 Dominican Rep. 232
## 64 East Germany 232
## 65 Ecuador 232
## 66 Egypt 232
## 67 El Salvador 232
## 68 Equatorial Guinea 232
## 69 Eritrea 232
## 70 Eritrea and Ethiopia 232
## 71 Estonia 232
## 72 Ethiopia 232
## 73 Faeroe Islands 232
## 74 Falkland Islands (Malvinas) 232
## 75 Fiji 232
## 76 Finland 232
## 77 France 232
## 78 French Guiana 232
## 79 French Polynesia 232
## 80 Gabon 232
## 81 Gambia 232
## 82 Georgia 232
## 83 Germany 232
## 84 Ghana 232
## 85 Gibraltar 232
## 86 Greece 232
## 87 Greenland 232
## 88 Grenada 232
## 89 Guadeloupe 232
## 90 Guam 232
## 91 Guatemala 232
## 92 Guernsey 232
## 93 Guinea 232
## 94 Guinea-Bissau 232
## 95 Guyana 232
## 96 Haiti 232
## 97 Holy See 232
## 98 Honduras 232
## 99 Hong Kong, China 232
## 100 Hungary 232
## 101 Iceland 232
## 102 India 232
## 103 Indonesia 232
## 104 Iran 232
## 105 Iraq 232
## 106 Ireland 232
## 107 Isle of Man 232
## 108 Israel 232
## 109 Italy 232
## 110 Jamaica 232
## 111 Japan 232
## 112 Jersey 232
## 113 Jordan 232
## 114 Kazakhstan 232
## 115 Kenya 232
## 116 Kiribati 232
## 117 Korea, Dem. Rep. 232
## 118 Korea, Rep. 232
## 119 Korea, United 232
## 120 Kosovo 232
## 121 Kuwait 232
## 122 Kyrgyzstan 232
## 123 Laos 232
## 124 Latvia 232
## 125 Lebanon 232
## 126 Lesotho 232
## 127 Liberia 232
## 128 Libya 232
## 129 Liechtenstein 232
## 130 Lithuania 232
## 131 Luxembourg 232
## 132 Macao, China 232
## 133 Macedonia, FYR 232
## 134 Madagascar 232
## 135 Malawi 232
## 136 Malaysia 232
## 137 Maldives 232
## 138 Mali 232
## 139 Malta 232
## 140 Marshall Islands 232
## 141 Martinique 232
## 142 Mauritania 232
## 143 Mauritius 232
## 144 Mayotte 232
## 145 Mexico 232
## 146 Micronesia, Fed. Sts. 232
## 147 Moldova 232
## 148 Monaco 232
## 149 Mongolia 232
## 150 Montenegro 232
## 151 Montserrat 232
## 152 Morocco 232
## 153 Mozambique 232
## 154 Myanmar 232
## 155 Namibia 232
## 156 Nauru 232
## 157 Nepal 232
## 158 Netherlands 232
## 159 Netherlands Antilles 232
## 160 New Caledonia 232
## 161 New Zealand 232
## 162 Ngorno-Karabakh 232
## 163 Nicaragua 232
## 164 Niger 232
## 165 Nigeria 232
## 166 Niue 232
## 167 Norfolk Island 232
## 168 Northern Cyprus 232
## 169 Northern Mariana Islands 232
## 170 Norway 232
## 171 Oman 232
## 172 Pakistan 232
## 173 Palau 232
## 174 Panama 232
## 175 Papua New Guinea 232
## 176 Paraguay 232
## 177 Peru 232
## 178 Philippines 232
## 179 Pitcairn 232
## 180 Poland 232
## 181 Portugal 232
## 182 Puerto Rico 232
## 183 Qatar 232
## 184 Reunion 232
## 185 Romania 232
## 186 Russia 232
## 187 Rwanda 232
## 188 Saint Barthélemy 232
## 189 Saint Helena 232
## 190 Saint Kitts and Nevis 232
## 191 Saint Lucia 232
## 192 Saint Martin 232
## 193 Saint Vincent and the Grenadines 232
## 194 Saint-Pierre-et-Miquelon 232
## 195 Samoa 232
## 196 San Marino 232
## 197 Sao Tome and Principe 232
## 198 Saudi Arabia 232
## 199 Senegal 232
## 200 Serbia 232
## 201 Serbia and Montenegro 232
## 202 Serbia excluding Kosovo 232
## 203 Seychelles 232
## 204 Sierra Leone 232
## 205 Singapore 232
## 206 Slovak Republic 232
## 207 Slovenia 232
## 208 Solomon Islands 232
## 209 Somalia 232
## 210 Somaliland 232
## 211 South Africa 232
## 212 South Ossetia 232
## 213 South Sudan 232
## 214 Spain 232
## 215 Sri Lanka 232
## 216 Sudan 232
## 217 Suriname 232
## 218 Svalbard 232
## 219 Swaziland 232
## 220 Sweden 232
## 221 Switzerland 232
## 222 Syria 232
## 223 Taiwan 232
## 224 Tajikistan 232
## 225 Tanzania 232
## 226 Thailand 232
## 227 Timor-Leste 232
## 228 Togo 232
## 229 Tokelau 232
## 230 Tonga 232
## 231 Transnistria 232
## 232 Trinidad and Tobago 232
## 233 Tunisia 232
## 234 Turkey 232
## 235 Turkmenistan 232
## 236 Turks and Caicos Islands 232
## 237 Tuvalu 232
## 238 USSR 232
## 239 Uganda 232
## 240 Ukraine 232
## 241 United Arab Emirates 232
## 242 United Kingdom 232
## 243 United States 232
## 244 Uruguay 232
## 245 Uzbekistan 232
## 246 Vanuatu 232
## 247 Venezuela 232
## 248 Vietnam 232
## 249 Virgin Islands (U.S.) 232
## 250 Wallis et Futuna 232
## 251 West Bank and Gaza 232
## 252 West Germany 232
## 253 Western Sahara 232
## 254 Yemen Arab Republic (Former) 232
## 255 Yemen Democratic (Former) 232
## 256 Yemen, Rep. 232
## 257 Yugoslavia 232
## 258 Zambia 232
## 259 Zimbabwe 232
## 260 Åland 232
groupBy(tot, by = Year)
## Year count
## 1 1700 260
## 2 1730 260
## 3 1750 260
## 4 1785 260
## 5 1786 260
## 6 1787 260
## 7 1788 260
## 8 1789 260
## 9 1790 260
## 10 1791 260
## 11 1792 260
## 12 1793 260
## 13 1794 260
## 14 1795 260
## 15 1796 260
## 16 1797 260
## 17 1798 260
## 18 1799 260
## 19 1800 260
## 20 1801 260
## 21 1802 260
## 22 1803 260
## 23 1804 260
## 24 1805 260
## 25 1806 260
## 26 1807 260
## 27 1808 260
## 28 1809 260
## 29 1810 260
## 30 1811 260
## 31 1812 260
## 32 1813 260
## 33 1814 260
## 34 1815 260
## 35 1816 260
## 36 1817 260
## 37 1818 260
## 38 1819 260
## 39 1820 260
## 40 1821 260
## 41 1822 260
## 42 1823 260
## 43 1824 260
## 44 1825 260
## 45 1826 260
## 46 1827 260
## 47 1828 260
## 48 1829 260
## 49 1830 260
## 50 1831 260
## 51 1832 260
## 52 1833 260
## 53 1834 260
## 54 1835 260
## 55 1836 260
## 56 1837 260
## 57 1838 260
## 58 1839 260
## 59 1840 260
## 60 1841 260
## 61 1842 260
## 62 1843 260
## 63 1844 260
## 64 1845 260
## 65 1846 260
## 66 1847 260
## 67 1848 260
## 68 1849 260
## 69 1850 260
## 70 1851 260
## 71 1852 260
## 72 1853 260
## 73 1854 260
## 74 1855 260
## 75 1856 260
## 76 1857 260
## 77 1858 260
## 78 1859 260
## 79 1860 260
## 80 1861 260
## 81 1862 260
## 82 1863 260
## 83 1864 260
## 84 1865 260
## 85 1866 260
## 86 1867 260
## 87 1868 260
## 88 1869 260
## 89 1870 260
## 90 1871 260
## 91 1872 260
## 92 1873 260
## 93 1874 260
## 94 1875 260
## 95 1876 260
## 96 1877 260
## 97 1878 260
## 98 1879 260
## 99 1880 260
## 100 1881 260
## 101 1882 260
## 102 1883 260
## 103 1884 260
## 104 1885 260
## 105 1886 260
## 106 1887 260
## 107 1888 260
## 108 1889 260
## 109 1890 260
## 110 1891 260
## 111 1892 260
## 112 1893 260
## 113 1894 260
## 114 1895 260
## 115 1896 260
## 116 1897 260
## 117 1898 260
## 118 1899 260
## 119 1900 260
## 120 1901 260
## 121 1902 260
## 122 1903 260
## 123 1904 260
## 124 1905 260
## 125 1906 260
## 126 1907 260
## 127 1908 260
## 128 1909 260
## 129 1910 260
## 130 1911 260
## 131 1912 260
## 132 1913 260
## 133 1914 260
## 134 1915 260
## 135 1916 260
## 136 1917 260
## 137 1918 260
## 138 1919 260
## 139 1920 260
## 140 1921 260
## 141 1922 260
## 142 1923 260
## 143 1924 260
## 144 1925 260
## 145 1926 260
## 146 1927 260
## 147 1928 260
## 148 1929 260
## 149 1930 260
## 150 1931 260
## 151 1932 260
## 152 1933 260
## 153 1934 260
## 154 1935 260
## 155 1936 260
## 156 1937 260
## 157 1938 260
## 158 1939 260
## 159 1940 260
## 160 1941 260
## 161 1942 260
## 162 1943 260
## 163 1944 260
## 164 1945 260
## 165 1946 260
## 166 1947 260
## 167 1948 260
## 168 1949 260
## 169 1950 260
## 170 1951 260
## 171 1952 260
## 172 1953 260
## 173 1954 260
## 174 1955 260
## 175 1956 260
## 176 1957 260
## 177 1958 260
## 178 1959 260
## 179 1960 260
## 180 1961 260
## 181 1962 260
## 182 1963 260
## 183 1964 260
## 184 1965 260
## 185 1966 260
## 186 1967 260
## 187 1968 260
## 188 1969 260
## 189 1970 260
## 190 1971 260
## 191 1972 260
## 192 1973 260
## 193 1974 260
## 194 1975 260
## 195 1976 260
## 196 1977 260
## 197 1978 260
## 198 1979 260
## 199 1980 260
## 200 1981 260
## 201 1982 260
## 202 1983 260
## 203 1984 260
## 204 1985 260
## 205 1986 260
## 206 1987 260
## 207 1988 260
## 208 1989 260
## 209 1990 260
## 210 1991 260
## 211 1992 260
## 212 1993 260
## 213 1994 260
## 214 1995 260
## 215 1996 260
## 216 1997 260
## 217 1998 260
## 218 1999 260
## 219 2000 260
## 220 2001 260
## 221 2002 260
## 222 2003 260
## 223 2004 260
## 224 2005 260
## 225 2006 260
## 226 2007 260
## 227 2008 260
## 228 2009 260
## 229 2010 260
## 230 2011 260
## 231 2012 260
## 232 2013 260
tally(~Country, data = tot)
##
## Abkhazia Afghanistan
## 232 232
## Akrotiri and Dhekelia Albania
## 232 232
## Algeria American Samoa
## 232 232
## Andorra Angola
## 232 232
## Anguilla Antigua and Barbuda
## 232 232
## Argentina Armenia
## 232 232
## Aruba Australia
## 232 232
## Austria Azerbaijan
## 232 232
## Bahamas Bahrain
## 232 232
## Bangladesh Barbados
## 232 232
## Belarus Belgium
## 232 232
## Belize Benin
## 232 232
## Bermuda Bhutan
## 232 232
## Bolivia Bosnia and Herzegovina
## 232 232
## Botswana Brazil
## 232 232
## British Virgin Islands Brunei
## 232 232
## Bulgaria Burkina Faso
## 232 232
## Burundi Cambodia
## 232 232
## Cameroon Canada
## 232 232
## Cape Verde Cayman Islands
## 232 232
## Central African Rep. Chad
## 232 232
## Channel Islands Chile
## 232 232
## China Christmas Island
## 232 232
## Cocos Island Colombia
## 232 232
## Comoros Congo, Dem. Rep.
## 232 232
## Congo, Rep. Cook Islands
## 232 232
## Costa Rica Cote d'Ivoire
## 232 232
## Croatia Cuba
## 232 232
## Cyprus Czech Rep.
## 232 232
## Czechoslovakia Denmark
## 232 232
## Djibouti Dominica
## 232 232
## Dominican Rep. East Germany
## 232 232
## Ecuador Egypt
## 232 232
## El Salvador Equatorial Guinea
## 232 232
## Eritrea Eritrea and Ethiopia
## 232 232
## Estonia Ethiopia
## 232 232
## Faeroe Islands Falkland Islands (Malvinas)
## 232 232
## Fiji Finland
## 232 232
## France French Guiana
## 232 232
## French Polynesia Gabon
## 232 232
## Gambia Georgia
## 232 232
## Germany Ghana
## 232 232
## Gibraltar Greece
## 232 232
## Greenland Grenada
## 232 232
## Guadeloupe Guam
## 232 232
## Guatemala Guernsey
## 232 232
## Guinea Guinea-Bissau
## 232 232
## Guyana Haiti
## 232 232
## Holy See Honduras
## 232 232
## Hong Kong, China Hungary
## 232 232
## Iceland India
## 232 232
## Indonesia Iran
## 232 232
## Iraq Ireland
## 232 232
## Isle of Man Israel
## 232 232
## Italy Jamaica
## 232 232
## Japan Jersey
## 232 232
## Jordan Kazakhstan
## 232 232
## Kenya Kiribati
## 232 232
## Korea, Dem. Rep. Korea, Rep.
## 232 232
## Korea, United Kosovo
## 232 232
## Kuwait Kyrgyzstan
## 232 232
## Laos Latvia
## 232 232
## Lebanon Lesotho
## 232 232
## Liberia Libya
## 232 232
## Liechtenstein Lithuania
## 232 232
## Luxembourg Macao, China
## 232 232
## Macedonia, FYR Madagascar
## 232 232
## Malawi Malaysia
## 232 232
## Maldives Mali
## 232 232
## Malta Marshall Islands
## 232 232
## Martinique Mauritania
## 232 232
## Mauritius Mayotte
## 232 232
## Mexico Micronesia, Fed. Sts.
## 232 232
## Moldova Monaco
## 232 232
## Mongolia Montenegro
## 232 232
## Montserrat Morocco
## 232 232
## Mozambique Myanmar
## 232 232
## Namibia Nauru
## 232 232
## Nepal Netherlands
## 232 232
## Netherlands Antilles New Caledonia
## 232 232
## New Zealand Ngorno-Karabakh
## 232 232
## Nicaragua Niger
## 232 232
## Nigeria Niue
## 232 232
## Norfolk Island Northern Cyprus
## 232 232
## Northern Mariana Islands Norway
## 232 232
## Oman Pakistan
## 232 232
## Palau Panama
## 232 232
## Papua New Guinea Paraguay
## 232 232
## Peru Philippines
## 232 232
## Pitcairn Poland
## 232 232
## Portugal Puerto Rico
## 232 232
## Qatar Reunion
## 232 232
## Romania Russia
## 232 232
## Rwanda Saint Barthélemy
## 232 232
## Saint Helena Saint Kitts and Nevis
## 232 232
## Saint Lucia Saint Martin
## 232 232
## Saint Vincent and the Grenadines Saint-Pierre-et-Miquelon
## 232 232
## Samoa San Marino
## 232 232
## Sao Tome and Principe Saudi Arabia
## 232 232
## Senegal Serbia
## 232 232
## Serbia and Montenegro Serbia excluding Kosovo
## 232 232
## Seychelles Sierra Leone
## 232 232
## Singapore Slovak Republic
## 232 232
## Slovenia Solomon Islands
## 232 232
## Somalia Somaliland
## 232 232
## South Africa South Ossetia
## 232 232
## South Sudan Spain
## 232 232
## Sri Lanka Sudan
## 232 232
## Suriname Svalbard
## 232 232
## Swaziland Sweden
## 232 232
## Switzerland Syria
## 232 232
## Taiwan Tajikistan
## 232 232
## Tanzania Thailand
## 232 232
## Timor-Leste Togo
## 232 232
## Tokelau Tonga
## 232 232
## Transnistria Trinidad and Tobago
## 232 232
## Tunisia Turkey
## 232 232
## Turkmenistan Turks and Caicos Islands
## 232 232
## Tuvalu USSR
## 232 232
## Uganda Ukraine
## 232 232
## United Arab Emirates United Kingdom
## 232 232
## United States Uruguay
## 232 232
## Uzbekistan Vanuatu
## 232 232
## Venezuela Vietnam
## 232 232
## Virgin Islands (U.S.) Wallis et Futuna
## 232 232
## West Bank and Gaza West Germany
## 232 232
## Western Sahara Yemen Arab Republic (Former)
## 232 232
## Yemen Democratic (Former) Yemen, Rep.
## 232 232
## Yugoslavia Zambia
## 232 232
## Zimbabwe Åland
## 232 232
## Total
## 60320
tally(~Year, data = tot)
##
## 1700 1730 1750 1785 1786 1787 1788 1789 1790 1791 1792 1793
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997
## 260 260 260 260 260 260 260 260 260 260 260 260
## 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
## 260 260 260 260 260 260 260 260 260 260 260 260
## 2010 2011 2012 2013 Total
## 260 260 260 260 60320
No.
Gapminder\LandArea.csv data …larea = fetchGapminder("Gapminder/LandArea.csv")
## Retrieving from
## http://www.mosaic-web.org/go/datasets/Gapminder/LandArea.csv
Are there countries that have changed in size over the years?
Hint: Use groupBy() with an operation of min(LandArea) != max(LandArea)
l.change = groupBy(larea, by = Country, min(LandArea) != max(LandArea))
change.yes = subset(l.change, vals == "TRUE")
change.yes
## Country vals
## 15 Bahrain TRUE
## 23 Bhutan TRUE
## 29 Bulgaria TRUE
## 41 China TRUE
## 48 Croatia TRUE
## 56 Ecuador TRUE
## 62 Ethiopia TRUE
## 65 Finland TRUE
## 71 Germany TRUE
## 75 Greenland TRUE
## 90 Iraq TRUE
## 96 Japan TRUE
## 97 Jordan TRUE
## 102 Korea, Rep. TRUE
## 105 Kyrgyzstan TRUE
## 107 Latvia TRUE
## 129 Moldova TRUE
## 138 Netherlands TRUE
## 145 Norway TRUE
## 154 Poland TRUE
## 155 Portugal TRUE
## 161 Saint Kitts and Nevis TRUE
## 173 Singapore TRUE
## 174 Slovak Republic TRUE
## 179 Spain TRUE
## 200 Ukraine TRUE
## 203 United States TRUE
## 208 Vietnam TRUE
mod1 = groupBy(larea, by = Country, min = min(LandArea), max = max(LandArea))
mod1$delta.area = mod1$max/mod1$min
ten.percent = subset(mod1, delta.area >= 1.1)
ten.percent
## Country min max delta.area
## 15 Bahrain 690 760 1.101
## 23 Bhutan 38390 47000 1.224
## 56 Ecuador 256370 283560 1.106
## 62 Ethiopia 1104300 1221900 1.106
## 75 Greenland 341700 410450 1.201
## 161 Saint Kitts and Nevis 260 350 1.346
Use subset() and join() to create a new data frame that has the country's population in 1990 as one variable and the population in 2010 as another variable.
pop1990 = subset(tot, Year == "1990")
pop1990 = transform(pop1990, tot.1990 = TotalPopulation)
pop1990$TotalPopulation <- NULL
pop1990$Year <- NULL
pop2010 = subset(tot, Year == "2010")
pop2010 = transform(pop2010, tot.2010 = TotalPopulation)
pop2010$TotalPopulation <- NULL
pop2010$Year <- NULL
pop.both = join(pop1990, pop2010)
## Joining by: Country
pop.both
## Country tot.1990 tot.2010
## 1 Abkhazia
## 2 Afghanistan 13,032,161 31,411,743
## 3 Akrotiri and Dhekelia
## 4 Albania 3,289,483 3,204,284
## 5 Algeria 25,299,182 35,468,208
## 6 American Samoa 47,052 68,420
## 7 Andorra 52,773 84,864
## 8 Angola 10,335,052 19,081,912
## 9 Anguilla 8,332 15,358
## 10 Antigua and Barbuda 62,202 88,710
## 11 Argentina 32,642,442 40,412,376
## 12 Armenia 3,544,695 3,092,072
## 13 Aruba 62,147 107,488
## 14 Australia 17,096,153 22,268,384
## 15 Austria 7,670,513 8,393,644
## 16 Azerbaijan 7,211,692 9,187,783
## 17 Bahamas 256,128 342,877
## 18 Bahrain 492,891 1,261,835
## 19 Bangladesh 105,256,026 148,692,131
## 20 Barbados 259,501 273,331
## 21 Belarus 10,259,700 9,595,421
## 22 Belgium 9,949,019 10,712,066
## 23 Belize 190,241 311,627
## 24 Benin 4,773,137 8,849,892
## 25 Bermuda 59,795 64,941
## 26 Bhutan 558,500 725,940
## 27 Bolivia 6,658,462 9,929,849
## 28 Bosnia and Herzegovina 4,308,197 3,760,149
## 29 Botswana 1,382,371 2,006,945
## 30 Brazil 149,650,206 194,946,470
## 31 British Virgin Islands 16,491 23,245
## 32 Brunei 252,125 398,920
## 33 Bulgaria 8,818,915 7,494,332
## 34 Burkina Faso 9,323,996 16,468,714
## 35 Burundi 5,601,720 8,382,849
## 36 Cambodia 9,531,928 14,138,255
## 37 Cameroon 12,180,819 19,598,889
## 38 Canada 27,700,854 34,016,593
## 39 Cape Verde 348,165 495,999
## 40 Cayman Islands 26,048 56,230
## 41 Central African Rep. 2,934,777 4,401,051
## 42 Chad 6,011,224 11,227,208
## 43 Channel Islands 140,137 153,352
## 44 Chile 13,187,821 17,113,688
## 45 China 1,145,195,229 1,341,335,152
## 46 Christmas Island 1,400
## 47 Cocos Island 596
## 48 Colombia 33,203,321 46,294,841
## 49 Comoros 437,876 734,750
## 50 Congo, Dem. Rep. 36,406,226 65,965,795
## 51 Congo, Rep. 2,388,902 4,042,899
## 52 Cook Islands 17,614 20,288
## 53 Costa Rica 3,070,240 4,658,887
## 54 Cote d'Ivoire 12,517,730 19,737,800
## 55 Croatia 4,517,200 4,403,330
## 56 Cuba 10,570,328 11,257,979
## 57 Cyprus 766,663 1,103,647
## 58 Czech Rep. 10,302,718 10,492,960
## 59 Czechoslovakia 15,572,130
## 60 Denmark 5,141,034 5,550,142
## 61 Djibouti 562,290 888,716
## 62 Dominica 70,926 67,757
## 63 Dominican Rep. 7,194,666 9,927,320
## 64 East Germany 16,111,000
## 65 Ecuador 10,260,587 14,464,739
## 66 Egypt 56,843,275 81,121,077
## 67 El Salvador 5,332,842 6,192,993
## 68 Equatorial Guinea 373,887 700,401
## 69 Eritrea 3,158,295 5,253,676
## 70 Eritrea and Ethiopia 51,193,511
## 71 Estonia 1,567,631 1,341,140
## 72 Ethiopia 48,333,261 82,949,541
## 73 Faeroe Islands 47,558 48,708
## 74 Falkland Islands (Malvinas) 1,993 3,017
## 75 Fiji 728,390 860,623
## 76 Finland 4,986,441 5,364,546
## 77 France 56,708,260 62,787,427
## 78 French Guiana 117,038 231,151
## 79 French Polynesia 195,383 270,764
## 80 Gabon 929,044 1,505,463
## 81 Gambia 966,151 1,728,394
## 82 Georgia 5,459,999 4,352,244
## 83 Germany 79,098,094 82,302,465
## 84 Ghana 14,793,415 24,391,823
## 85 Gibraltar 26,830 29,244
## 86 Greece 10,160,501 11,359,346
## 87 Greenland 55,552 57,296
## 88 Grenada 96,200 104,487
## 89 Guadeloupe 386,465 460,666
## 90 Guam 133,914 179,896
## 91 Guatemala 8,923,131 14,388,929
## 92 Guernsey 62,623
## 93 Guinea 5,759,374 9,981,590
## 94 Guinea-Bissau 1,016,695 1,515,224
## 95 Guyana 724,931 754,493
## 96 Haiti 7,124,877 9,993,247
## 97 Holy See 770 458
## 98 Honduras 4,889,311 7,600,524
## 99 Hong Kong, China 5,793,857 7,053,189
## 100 Hungary 10,376,320 9,983,645
## 101 Iceland 254,793 320,136
## 102 India 873,785,449 1,224,614,327
## 103 Indonesia 184,345,939 239,870,937
## 104 Iran 54,870,583 73,973,630
## 105 Iraq 17,373,767 31,671,591
## 106 Ireland 3,531,219 4,469,900
## 107 Isle of Man 70,313 82,869
## 108 Israel 4,499,949 7,418,400
## 109 Italy 56,832,330 60,550,848
## 110 Jamaica 2,364,909 2,741,052
## 111 Japan 122,251,184 126,535,920
## 112 Jersey 83,609
## 113 Jordan 3,415,567 6,187,227
## 114 Kazakhstan 16,530,000 16,026,367
## 115 Kenya 23,447,177 40,512,682
## 116 Kiribati 71,835 99,546
## 117 Korea, Dem. Rep. 20,143,212 24,346,229
## 118 Korea, Rep. 42,980,365 48,183,584
## 119 Korea, United 62,887,546
## 120 Kosovo 1,670,808
## 121 Kuwait 2,087,687 2,736,732
## 122 Kyrgyzstan 4,394,502 5,334,223
## 123 Laos 4,192,414 6,200,894
## 124 Latvia 2,663,905 2,252,060
## 125 Lebanon 2,948,372 4,227,597
## 126 Lesotho 1,639,177 2,171,318
## 127 Liberia 2,127,098 3,994,122
## 128 Libya 4,334,459 6,355,112
## 129 Liechtenstein 28,986 36,032
## 130 Lithuania 3,695,890 3,323,611
## 131 Luxembourg 381,225 507,448
## 132 Macao, China 359,709 543,656
## 133 Macedonia, FYR 1,909,353 2,060,563
## 134 Madagascar 11,280,625 20,713,819
## 135 Malawi 9,380,892 14,900,841
## 136 Malaysia 18,208,562 28,401,017
## 137 Maldives 219,474 315,885
## 138 Mali 8,672,868 15,369,809
## 139 Malta 367,524 416,515
## 140 Marshall Islands 47,288 54,038
## 141 Martinique 359,377 405,814
## 142 Mauritania 1,995,548 3,459,773
## 143 Mauritius 1,059,548 1,299,172
## 144 Mayotte 92,413 204,114
## 145 Mexico 84,306,602 113,423,047
## 146 Micronesia, Fed. Sts. 96,319 111,064
## 147 Moldova 4,363,950 3,572,885
## 148 Monaco 30,896 35,407
## 149 Mongolia 2,192,553 2,756,001
## 150 Montenegro 608,816 631,490
## 151 Montserrat 10,714 5,934
## 152 Morocco 24,781,105 31,951,412
## 153 Mozambique 13,547,076 23,390,765
## 154 Myanmar 39,268,304 47,963,012
## 155 Namibia 1,414,830 2,283,289
## 156 Nauru 9,157 10,255
## 157 Nepal 19,081,064 29,959,364
## 158 Netherlands 14,891,719 16,612,988
## 159 Netherlands Antilles 190,539 200,689
## 160 New Caledonia 169,689 250,870
## 161 New Zealand 3,397,983 4,368,136
## 162 Ngorno-Karabakh
## 163 Nicaragua 4,120,797 5,788,163
## 164 Niger 7,788,198 15,511,953
## 165 Nigeria 97,552,057 158,423,182
## 166 Niue 2,333 1,468
## 167 Norfolk Island
## 168 Northern Cyprus
## 169 Northern Mariana Islands 43,973 60,917
## 170 Norway 4,241,485 4,883,111
## 171 Oman 1,868,055 2,782,435
## 172 Pakistan 111,844,679 173,593,383
## 173 Palau 15,089 20,472
## 174 Panama 2,415,926 3,516,820
## 175 Papua New Guinea 4,157,654 6,858,266
## 176 Paraguay 4,243,860 6,454,548
## 177 Peru 21,685,537 29,076,512
## 178 Philippines 61,628,668 93,260,798
## 179 Pitcairn 65 50
## 180 Poland 38,056,174 38,276,660
## 181 Portugal 9,925,477 10,675,572
## 182 Puerto Rico 3,528,815 3,749,009
## 183 Qatar 473,722 1,758,793
## 184 Reunion 612,034 846,068
## 185 Romania 23,206,719 21,486,371
## 186 Russia 148,243,501 142,958,164
## 187 Rwanda 7,109,538 10,624,005
## 188 Saint Barthélemy 5,038 9,141
## 189 Saint Helena 5,537 4,118
## 190 Saint Kitts and Nevis 40,731 52,402
## 191 Saint Lucia 138,042 174,267
## 192 Saint Martin
## 193 Saint Vincent and the Grenadines 107,449 109,333
## 194 Saint-Pierre-et-Miquelon 6,279 6,046
## 195 Samoa 161,308 183,081
## 196 San Marino 24,134 31,534
## 197 Sao Tome and Principe 116,117 165,397
## 198 Saudi Arabia 16,139,053 27,448,086
## 199 Senegal 7,241,573 12,433,728
## 200 Serbia 9,568,744 9,856,222
## 201 Serbia and Montenegro 9,935,057
## 202 Serbia excluding Kosovo 7,897,937
## 203 Seychelles 71,031 86,518
## 204 Sierra Leone 3,981,567 5,867,536
## 205 Singapore 3,016,624 5,086,418
## 206 Slovak Republic 5,270,072 5,462,119
## 207 Slovenia 1,926,701 2,029,680
## 208 Solomon Islands 309,527 538,148
## 209 Somalia 6,599,249 9,330,872
## 210 Somaliland
## 211 South Africa 36,793,907 50,132,817
## 212 South Ossetia
## 213 South Sudan 5420563 9415421
## 214 Spain 38,889,158 46,076,989
## 215 Sri Lanka 17,337,048 20,859,949
## 216 Sudan 21,073,606 34,136,520
## 217 Suriname 406,890 524,636
## 218 Svalbard 3,544
## 219 Swaziland 862,947 1,186,056
## 220 Sweden 8,558,829 9,379,687
## 221 Switzerland 6,673,738 7,664,318
## 222 Syria 12,324,116 20,410,606
## 223 Taiwan 20,278,000 23,025,000
## 224 Tajikistan 5,303,152 6,878,637
## 225 Tanzania 25,478,979 44,841,226
## 226 Thailand 57,072,058 69,122,234
## 227 Timor-Leste 743,145 1,124,355
## 228 Togo 3,665,509 6,027,798
## 229 Tokelau 1,609 1,135
## 230 Tonga 95,150 104,058
## 231 Transnistria
## 232 Trinidad and Tobago 1,215,494 1,341,465
## 233 Tunisia 8,215,111 10,480,934
## 234 Turkey 54,130,268 72,752,325
## 235 Turkmenistan 3,668,000 5,041,995
## 236 Turks and Caicos Islands 11,549 38,354
## 237 Tuvalu 9,004 9,827
## 238 Uganda 17,699,717 33,424,683
## 239 Ukraine 51,644,914 45,448,329
## 240 United Arab Emirates 1,808,642 7,511,690
## 241 United Kingdom 57,214,474 62,035,570
## 242 United States 253,339,097 310,383,948
## 243 Uruguay 3,109,122 3,368,786
## 244 USSR 288,544,755
## 245 Uzbekistan 20,515,248 27,444,702
## 246 Wallis et Futuna 13,882 13,566
## 247 Vanuatu 146,636 239,651
## 248 Venezuela 19,685,177 28,979,857
## 249 West Bank and Gaza 2,081,424 4,039,192
## 250 West Germany 63,254,000
## 251 Western Sahara 220,794 530,500
## 252 Vietnam 67,101,583 87,848,445
## 253 Virgin Islands (U.S.) 103,253 109,056
## 254 Yemen Arab Republic (Former) 9,632,403
## 255 Yemen Democratic (Former) 2,681,173
## 256 Yemen, Rep. 11,948,209 24,052,514
## 257 Yugoslavia 22,719,621
## 258 Zambia 7,860,053 13,088,570
## 259 Zimbabwe 10,469,202 12,571,454
## 260 Åland 24,604 26,923
transform() and cut() to create a prewar variable indicating whether data are from before World War II. Use levels: “pre” and “post”transform() and cut() to create a decade variable coded as “1980s”, “1990s”, “2000s” subset(), transform() and ntiles() to divide up countries into 5 categories according to their GDP in 2010.
groupBy() to find the range of GDP in each of the categories. Hint: max() and min()groupBy(), transform() and ntiles() to divide up countries into 5 categories according to how much their GDP has grown from 1990 to 2010.groupBy(), transform() and ntiles() to divide up countries into 5 categories according to how much their population has grown from 1990 to 2010.cut() to divide countries up