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 rnaturalearth
package but the geometries given are:
- Multipolygons
- Do not conform with the polygons I have in my dataset.
The code used to get the relevant data is:
library(rnaturalearth)
world_map <- ne_countries(scale = "large", returnclass = 'sf')
canada_map <- world_map %>% filter(name =="Canada")
Is there a way that I can scale my data so that I can make my Canadian polygons work with the Canadian Polygons in rnatural earth
? I have tried to "force" the polygons from my data to have them work with rnaturalearth
but it doesn't line up at all.
I hope I was able to explain myself. Any help is greatly appreciated!