List of visits from the rworldmap list

Is there a way to get a list of countries, regions (?) And continents that rworldmap supports when I want to join data?

I have done some Google searches and start with R.

Thank.

+5
source share
5 answers

It seems to me that the package rworldmapprovides some additional features on top of the package maps.

If this is true, you can do the following:

library(maps)
x <- map("world", plot=FALSE)
str(x)
List of 4
 $ x    : num [1:27121] -130 -130 -132 -132 -132 ...
 $ y    : num [1:27121] 55.9 56.1 56.7 57 57.2 ...
 $ range: num [1:4] -180 190.3 -85.4 83.6
 $ names: chr [1:2284] "Canada" "South Africa" "Denmark" "Great Lakes:Superior, Huron, Michigan" ...
 - attr(*, "class")= chr "map"

maps, names . , . , , :

x$names[grep("UK", x$names)]
 [1] "UK:Gibralter"                         
 [2] "UK:Scotland:Isle of Lewis"            
 [3] "UK:Pitcairn Island"                   
 [4] "UK:Guernsey"                          
 [5] "UK:Great Britain"                     
 [6] "UK:Scotland:Shetland Islands:Unst"    
 [7] "UK:Saint Mary's"                      
 [8] "UK:Scotland:Shetland Islands:Yell"    
 [9] "UK:Northern Ireland"                  
[10] "UK:Bermuda"                           
[11] "UK:Tristan da Cunha Island"           
[12] "UK:Scotland:Saint Kilda"              
[13] "UK:Scotland:Ruhm"                     
[14] "UK:Scotland:Benbecula"                
[15] "UK:Scotland:North Uist"               
[16] "UK:Saint Helena Island"               
[17] "UK:Scotland:Island of Skye"           
[18] "UK:Scotland:Barra"                    
[19] "UK:Scotland:Island of Mull"           
[20] "UK:Henderson Island"                  
[21] "UK:Isle of Sheppey"                   
[22] "UK:Jersey"                            
[23] "UK:Scotland:Coll"                     
[24] "UK:Scotland:Jura"                     
[25] "UK:Scotland:Island of Arran"          
[26] "UK:Scotland:Tiree"                    
[27] "UK:Scotland:Islay"                    
[28] "UK:Ascension Island"                  
[29] "UK:Scotland:Colonsay"                 
[30] "UK:Scotland:Shetland Islands:Mainland"
[31] "UK:Scotland:South Uist"               
[32] "UK:Scotland:Orkney Islands:Hoy"       
[33] "UK:Gough Island"                      
[34] "UK:Scotland:Orkney Islands:Mainland"  
+6

, , :

require(rworldmap)
data(countryExData
countries <- countryExData[ , 2]
EPI_regions <- countryExData[ , 3]
GEO_regions <- countryExData[ , 4]

, , ht e GEO_regions:

> countryExData[ 1:10, 2:4]
                            Country                  EPI_regions
1                            Angola           Sub-Saharan Africa
2                           Albania    Central and Eastern Europ
3  United Arab Emirates             Middle East and North Africa
4                         Argentina    Latin America and Caribbe
5                           Armenia Middle East and North Africa
6                         Australia    East Asia and the Pacific
7                           Austria                       Europe
8                        Azerbaijan    Central and Eastern Europ
9                           Burundi           Sub-Saharan Africa
10                          Belgium                       Europe
             GEO_subregion
1          Southern Africa
2           Central Europe
3        Arabian Peninsula
4            South America
5           Eastern Europe
6  Australia + New Zealand
7           Western Europe
8           Eastern Europe
9           Eastern Africa
10          Western Europe
+2

, . .

library(rworldmap)
temp_map = getMap(resolution='coarse')
temp_map@data

temp_map@data[['NAME']]. , ISO, . , . , -' , circumflex -, .

+2

Take a look at feature map_datac ggplot2. It converts R cards to data.frames.

0
source

I got an error that led me to this getMap () $ NAME solution

0
source

All Articles