Questions tagged [rnaturalearth]
24 questions
0
votes
0 answers
R+natural earth: download bounding box fails
I am experiencing some trouble with a command that used to work in the past to download and use a bounding box from the natural earth website.
See this snippet
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from…

larry77
- 1,309
- 14
- 29
0
votes
1 answer
R - rnaturalearth multiple countries
I am trying to plot parts of three countries using ggplot2 and rnaturalearth, but for some reason it is only possible two plot two at a time and sometimes ony one. I have no idea why that is happening. The code below only plots Denmark, if I change…

Kj Ell
- 23
- 4
0
votes
1 answer
Does the order of locations change when making a voronoi map with leaft and sf?
I am making a voronoi map in R using the packages leaflet and sf as follows:
library(leaflet)
library(sf)
library(rnaturalearth)
library(rnaturalearthdata)
long <- c(4.35556 , 5.83745, 4.63683 , 6.06389, 6.41111, 5.639722)
lat <-…

WJH
- 539
- 5
- 14
0
votes
1 answer
Adding coordinates as points to a map in R
I have a dataframe of sightings and objects with their latitudes and longitudes:
object = c("yacht", "fishingboat", "whale")
long = c(-123.02676, -123.39763, -123.25103)
lat = c(38.22033, 38.05059, 38.32280)
df = cbind.data.frame(long, lat)
I want…

Muhammad Kamil
- 635
- 2
- 15
0
votes
1 answer
Unexpected result when plotting sf object from "rnaturalearth" after having removed countries' political borders
In what follows, a quick example with annotated steps. What I am attempting to do is remove country borders from original sf object loaded from rnaturalearth
Load needed libraries
library(tidyverse)
library(rnaturalearth)
library(sf)
assign sf…

Raed Hamed
- 327
- 1
- 10
0
votes
0 answers
Plotting rivers drainages on a map in R: issues with vector lines
I'm using the rivers_lake_centerlines dataset from rnaturalearth to plot rivers on a map in R. The map is produced with ggmap. My workflow:
# download and save river drainages as an object
rivers10 <- ne_download(scale = 10, type =…

user12167116
- 31
- 4
0
votes
0 answers
How to rescale Polygons in R (Canadian Data)
I have a dataset (2.7 million rows< ) which has given me geometries of various polygons which yields the visual below with this code:
library(tidyverse)
library(sf)
dt %>%
st_as_sf(wkt = "geometry")%>%
ggplot()+
geom_sf()
I am trying to use the…

Bensstats
- 988
- 5
- 17
0
votes
0 answers
create a 3D world map from a 2D in R
I would like to use a 2D map of the world that I already created to build a 3D map in which the height of every country (as a polygon) is linked to a specific integer number (coming from a cluster analysis) and colour the country in relation to the…

TheGrown
- 3
- 3
0
votes
1 answer
R, ggplot2, sf and rnaturalearth: an easy way to switch from one projection to another
First of all let me say that I am not a cartographer.
I need to plot a map of Europe with some segments connecting the European capitals. Without going into the details, I provide a simplified example in the reprex at the end of the post. It is very…

larry77
- 1,309
- 14
- 29