Created
October 13, 2017 17:32
-
-
Save barryrowlingson/28c502d45830b2736ae8211b055bedce to your computer and use it in GitHub Desktop.
R markdown that has a problem with tmap_arrange..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> packageVersion("tmap") | |
[1] ‘1.8’ | |
> packageVersion("rmarkdown") | |
[1] ‘1.5’ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
output: | |
html_document: | |
toc: true | |
--- | |
Here's how I run this. Note my default graphics device isn't cairo-enabled, so the | |
first line is needed. | |
``` | |
options(bitmapType="cairo") | |
library(rmarkdown) | |
render("fnord.Rmd","html_document") | |
``` | |
If I haven't started a graphics device then the output HTML has the images in. If I *have* | |
started a graphics device, for example: | |
``` | |
X11(type="cairo") | |
``` | |
then the maps get drawn to that and don't appear in the HTML output. | |
```{r test} | |
library(tmap) | |
data(World) | |
w1 <- qtm(World, projection = "eck4", title="Eckert IV") | |
w2 <- qtm(World, projection = "merc", title="Mercator") | |
# tmap_mode("plot") | |
tmap_arrange(w1, w2) | |
# tmap_mode("plot") | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that mucking with tmap_mode("plot") here and there modifies the behaviour in weird and unusual ways.