I am looking for a way to represent density points using heatmaps in R for printed media (e.g. using Rmarkdown to generate a PDF).
The map should have a basemap (OpenStreetMap or Stammen) and instead of presenting all points I want them to be presented as a density heatmap overlayed.
I know there are several ways to create heatmaps in R, like leaflet.extras's addHeatmap() for HTML maps. Unfortunately, they can't be exported to PDF (or other formats different to html).
ggmap, on the contrary, is aimed for printed maps, but unfortunately, it has two main problems: 1) it requires google API key (I do not want to do do it, neither I want to use google services) 2) it is quite cumbersome, as it requires knowing bounding box beforehand and, since I have to do plenty of maps, I need an automated way to get that bounding box (ideally without requiring other packages, such as osmdata's getbb()).
tmap would be a great solution, as it allows re-using same code for printed and interactive maps, but I haven't found any documentation about generating heatmaps.
Is there any way to achieve what I am looking for?

