I am trying to make a map in R and need some help, I have latitude and longitude coordinates of hotels in China and I want to map them but I can't seem to create a map specific to china and wanted to know if there is a way to fit those coordinates in a map specific to china. I have attached the screenshot of the map I got!
This solution depends on using a geographic source in the form of a "simple features" object, which is a data frame specialized for geographic information systems.
library(ggplot2)
library(sf)
#> Linking to GEOS 3.9.0, GDAL 3.2.2, PROJ 7.2.1
library(magrittr)
library(spData)
#> To access larger datasets in this package, install the spDataLarge
#> package with: `install.packages('spDataLarge',
#> repos='https://nowosad.github.io/drat/', type='source')`
data("world")
world[140,] %>% st_geometry() %>% ggplot() + geom_sf() + theme_minimal()