Questions tagged [rnaturalearth]
24 questions
4
votes
1 answer
How to plot GeoTIFF using tmap in R?
A simple plotRGB leads to the original image while plotting with tmap returns only a blue-shaded image. What am I doing wrong?
original image
blue-shaded image
Code snippet:
library(raster)
library(tmap)
library(rnaturalearth)
ne_download(scale =…

shar0n
- 41
- 1
4
votes
2 answers
Mousehover over country in leaflet to see its name
I am creating a map of the world:
library(leaflet)
library(rnaturalearth)
countries <- rnaturalearth::countries110
mymap <- leaflet(countries)
mymap %>% addPolygons(stroke = FALSE, smoothFactor = 0.2, fillOpacity = 1)
Is it possible to either hover…

user2323534
- 585
- 1
- 6
- 18
1
vote
1 answer
remove N and W labels from map tick marks
I'm making a map in ggplot, and because I'm using the rnaturalearth package for the world basemap, the tick mark labels have N and W in them.
How do I remove the square box and the N or W symbols in the tick marks? The longitude values should be -0…

tnt
- 1,149
- 14
- 24
1
vote
2 answers
Issue with R script to create a static map of New Zealand
I am trying to create a New Zealand map using this script with ggplot2 in R.
library(sf) #'simple features' package
library(leaflet) # web-embeddable interactive maps
library(ggplot2) # general purpose plotting
library(rnaturalearth) # map…

Miriam
- 11
- 1
1
vote
1 answer
Recenter map that crosses international dateline with ggplot and geom_sf
Consider the map of Europe below. Parts of Russia are on the other side of the map. How might I "recenter" the map so that there is less empty space? I guess I need to somehow move the polygons on the left to the…

Kene David Nwosu
- 828
- 6
- 12
1
vote
1 answer
Binding several sf together only plots first layer
I'm trying to create a script to generate generic maps with bathymetry, and I'm struggling to get it to work.
My issue is that depending on the map I want to make, I will call different bathymetric layers, but when I bind them together, only the…

Fred-LM
- 300
- 1
- 11
1
vote
1 answer
Transforming from EPSG:4326 to EPSG:3857 massively inflates longitude and latitude numbers
I've downloaded a world map and want to change it from the default CRS (EPSG:4326) to the WGS 84 / Pseudo-Mercator projection used in applications like Tableau and Google Maps (EPSG:3857). For some reason, when I attempt the transformation, the…

Obed
- 403
- 3
- 12
1
vote
1 answer
r: Displaying Eastern Russia and North America on one map rnaturalearth
I'm still learning how to use R. I'm trying to display points in North America and Eastern Russia using the package "rnaturalearth". I'd like to just show Russia and North America, rather than all of Europe. I've included a picture with the area of…

bigblue5295
- 13
- 2
0
votes
0 answers
How to buffer coastlines from rnaturalearth?
I need to be able to generate buffer shapes of the global coastline to filter vessel traffic data. The buffer I'm currently trying to generate is for 200 nautical miles, but hopefully the method can be generalized to larger or smaller distances. I…

geetlord
- 33
- 1
- 5
0
votes
2 answers
How to change the coordinate system without losing the data points in the new transformed plot?
I have a dataframe, called coords which contains x and y coordinates. (Please see below to get the output of dput(coords) for reproducibility.
I add a column containing a random value for each pair of coordinates:
# load…

bird
- 2,938
- 1
- 6
- 27
0
votes
1 answer
Fundamental misunderstanding with crs and map projections in R
I think I have a fundamental misunderstanding with how using crs and map projections work in R. First let me show what my final goal is here. I would like to create something like the following:
Using rnaturalearth. Specifically I am interested in…

Fish_Person
- 107
- 5
0
votes
1 answer
In R leaflet interactive map, all my values get incorrectly displayed (while values inside data frames are all correct)
For some reason, despite the fact Syria in the dataframe has Value = 1, when I plot the map it shows up as 0.038 and is called Belarus... and all the other countries also get some crazy values and other country names... I don't understand why it…

user165426
- 7
- 4
0
votes
2 answers
Keep identifiers when calculating st_length() in sf package in r
I want to calculate the distance from the centroid of every US state to the centroid of Kentucky. I achieve this using the following code:
library(rnaturalearth)
library(sf)
library(tidyverse)
library(nngeo)
us <- ne_states("United States of…

johnny
- 423
- 3
- 10
0
votes
2 answers
rnaturalearth lists three Belgian regions instead of Belgium. How to fix?
I am using the rnaturalearth and rnaturalearthdata for plotting choropleth maps. There is one problem: rnaturalearth lists the three Belgian regions (Brussels, Flemish and Walloon) instead of Belgian as a country. Is there a possibility to correct…

Monika
- 13
- 5
0
votes
1 answer
R+natural earth + bounding box and equator missing
Please have a look at the reprex at the end of this post. I should say that because of an issue with the ne_download function, the reprex requires the development version of rnaturalearth. See
R+natural earth: download bounding box fails
The code…

larry77
- 1,309
- 14
- 29