Questions tagged [rworldmap]

rworldmap is a package for the r language which is used to map and analyze country level datasets.

rworldmap is a package for the language which is used to map and analyze country level datasets.

Cran Page

Reference PDF

120 questions
27
votes
2 answers

Convert latitude and longitude coordinates to country name in R

I have a list of latitude and longitude coordinates, and wish to find out which country they all reside in. I modified an answer from this question about lat-long to US states, and have a working function, but I run into the problem that the…
Iain S
  • 2,643
  • 3
  • 23
  • 23
25
votes
3 answers

How to create a world map in R with specific countries filled in?

I would like to use R to generate a very basic world map with a specific set of countries filled with a red colour to indicate that they are malaria endemic countries. I have a list of these countries in a data frame but am struggling to overlay…
phlancelot
  • 281
  • 1
  • 4
  • 7
11
votes
5 answers

rworldmap package countrylist

Is there a way to obtain the list of countries, regions (?) and continents the rworldmap package supports when I want to join data? I did some google searches and am just starting off with R. Thanks.
cs0815
  • 16,751
  • 45
  • 136
  • 299
10
votes
1 answer

Graphic not appearing in R: null device?

I'm trying to produce a graphic using rworldmap, using my data frame dagg. ETA: data. Here's what I have so far. library(rworldmap) data(dagg) sPDF <- joinCountryData2Map(dagg, joinCode='ISO2', nameJoinColumn='country',…
Anshu Chen
  • 423
  • 2
  • 9
  • 23
8
votes
2 answers

R: creating a world network map

I would like to produce a world network map in R similar to the one below from this page. I have been looking for an R package that will allow me to do this but I have not been able to find one. There is D3 JavaScript Network Graphs from R but I…
adam.888
  • 7,686
  • 17
  • 70
  • 105
7
votes
1 answer

Highlighting specific countries (Ethiopia, Uganda, Kenya) using rworldmap library and map function

I am using this code using the package mapdata, however it only show the three countries I have selected, and I cannot see the rest of the world´s map boundaries. map("world", regions=c("ethiopia", "kenya", "uganda"), exact = TRUE, …
Carvalho
  • 279
  • 1
  • 2
  • 11
6
votes
1 answer

How do I make a world map without Antarctica?

I'm making world maps with the rworldmap package. I'm using a function to access trade data from UN Comtrade. I edited my original question so I can show a real example of what I'm doing. Here is a map that I could…
esterodr
  • 117
  • 1
  • 7
5
votes
1 answer

Plot colour coded world map using ggplot2

I am trying to generate a generate a plot of a world map where the colour of each country corresponds to a particular value stored in a data frame. > aggregated_country_data country num_responses region 1 …
Brad Davis
  • 1,063
  • 3
  • 18
  • 38
5
votes
2 answers

Creating maps in R just like the way rworldmap does but for specific country with provinces

I use the rworldmap package with WorldBank Data and I enjoy it. I want to plot maps for Iran, with data related to each province. What are the steps to do that? I know we can plot maps like that in R for some countries like US but not for all…
MEcon
  • 395
  • 4
  • 23
4
votes
1 answer

R - Print specific country names in a map using rworldmap

I am creating a heatmap using the map of Europe in rworldmap package in R (since I don't know how to do this with ggmap or ggplot2). I need to plot the country names of the countries that are present in my dataframe only, not all european…
Fierce82
  • 408
  • 5
  • 17
4
votes
1 answer

R: rworldmap map issue and leaflet application

I have made a leaflet map to overlay some countries on a R leaflet webmap, however there seems to be something wrong with the projection/layout and part of Russia finds it way onto the adjacent frame. The code:…
Arihant
  • 589
  • 9
  • 24
4
votes
1 answer

Names of the countries on the plot with rworldmap

Good morning, I have spent a lot of time to figure out how can I add a country names directly on plot not like a part of legend, but like part of map. Im using package rworldmap, tried to use identifyCountries () - but it something for interaction…
Dima Sukhorukov
  • 129
  • 4
  • 13
4
votes
1 answer

Poor resolution of raster plot when output to file

I have a reasonably high definition global map raster and want to plot to file, but cannot seem to maintain resolution. Plotting a restricted region works ok, but the whole world always ends up with reduced resolution, no matter what method I've…
geotheory
  • 22,624
  • 29
  • 119
  • 196
4
votes
1 answer

How to add/persist any number of plot layers on click in Shiny

Following the answer given in this question, I can get a polygon to render on a plot with each click: However, I can't seem to find an easy way to allow the polygon() to persist. The way I have it now, the both the initial plot and the annotation…
bright-star
  • 6,016
  • 6
  • 42
  • 81
3
votes
2 answers

R - how to get a smooth curve between two points?

I'm trying to draw a line between two cities, on a world map, using R (using map and wrld_simpl). How can I get a smooth line between the two points? If I drew a line between US and Australia, it has three different…
user187809
1
2 3 4 5 6 7 8