The function st_as_sf() makes it possible to transform a data.frame container of geographic coordinates into an object sf. Here we use the data.frameplaces2 created in the previous point.
OpenStreetMap (OSM) is a participatory mapping project that aim s to buil a free geographic database on a global scale. OpenStreetMap lets you view, edit and use geographic data around the world.
Terms of use
OpenStreetMap is open data : you are free to use it for ant purpose as long as you credit OpenStreetMap and its contributers. If you modify or rely data in any way, you may distribute the result only under the same license. (…)
Contributors
(…) Our contributors incloude enthusiastic mapmakers, GIS professional, engineers running OSM servers, humanitarians mapping disaster-stricken areas and many mmore.(…)
The package maptiles(Giraud 2021) allows downlaoding and displaying raster basemaps.
The function get_tiles() allow you to download OSM background maps and the function plot_tiles() allows to display them.
Renders are better if the input data used the same coordinate system as the tiles (EPSG:3857).
Appelhans, Tim, Florian Detsch, Christoph Reudenbach, and Stefan Woellauer. 2022. “Mapview: Interactive Viewing of Spatial Data in r.”https://CRAN.R-project.org/package=mapview.
Cheng, Joe, Bhaskar Karambelkar, and Yihui Xie. 2022. “Leaflet: Create Interactive Web Maps with the JavaScript ’Leaflet’ Library.”https://CRAN.R-project.org/package=leaflet.