Open Nowosad opened 3 years ago
Yes, I am aware of it. I already found a way how to solve it, which will be applied in v4. If it isn't too much effort I'll fix it in v3 as well, but it has low priority.
Is this the same issue as below ?:
tmap_mode("view")
qtm(World)
@mtennekes , another failure in Spatial Data Science with R was the absence of tmap_grob()
, do you plan to add it back for tmap v4?
pol_pres15$sps1 <- sps[,mr]
tm1 <- tm_shape(pol_pres15) +
tm_fill("sps1", title = "Shortest path\ncount")
coords[mr] |>
st_distance(coords) |>
c() |>
(function(x) x/1000)() |>
units::set_units(NULL) -> pol_pres15$dist_52
library(ggplot2)
g1 <- ggplot(pol_pres15, aes(x = sps1, y = dist_52)) +
geom_point() +
xlab("Shortest path count") +
ylab("km distance")
gridExtra::grid.arrange(tmap_grob(tm1), g1, nrow=1)
This is in Chapter 14 https://r-spatial.org/book/14-Areal.html#fig-shortestpath
tmap_grob()
opens a new graphic device, which creates an empty plot (both in RStudio, but also in other sessions; see reprex below). It is a minor inconvenience, but hopefully it could be easily fixed.Created on 2021-01-23 by the reprex package (v0.3.0)