ropensci / osmplotr

Data visualisation using OpenStreetMap objects
https://docs.ropensci.org/osmplotr
135 stars 21 forks source link

How to use the maps in RMarkdown #42

Open maelle opened 6 years ago

maelle commented 6 years ago

I am sorry if I missed something in the docs. To know how to integrate a map in an RMarkdown document, I had to look at the source of vignettes. Is the solution used in vignettes the simplest one? Then, is it documented somewhere? And last, could it be simplified? E.g. in order to be able to use maps like magick objects.

mpadge commented 6 years ago

This is a great idea that i should and will definitely look into further. They could be used just like any ggplott2 objects via the standard print method, but that's not really encouraged because printing like that can take literally minutes. But nor do i really document that, yet of course there is a need to incorporate maps within markdown docs, and that need needs to be addressed through documentation. I'll definitely attend to this issue. Thanks!

maelle commented 6 years ago

For the record I really like how magick does that so you could maybe "just" return a magick object when no device is given?