I have the bounderies for the municipalities in the "capital region" of Denmark. The acctual map looks like this:
The yellow island is the fourth row in my sf object.
I am trying to folllow the example at the end of section 8.2.7 in this book (link). That is I need to make the yellow island smaller and move it closer to the rest. Also there seems not to be any tags for tmap, but that is the package the link uses.
I have tried this code:
RH <- geo %>%
filter(REGIONKODE=="1084") %>%
select(KOMNAVN, AREAL) %>%
filter(!(KOMNAVN %in% c("Christiansø", "Bornholm"))) %>%
arrange(KOMNAVN)
Bornholm <- geo %>%
filter(KOMNAVN=="Bornholm")
mainland <- tm_shape(RH, projection = 2163) + tm_polygons() +
tm_layout(frame = FALSE)
Bornholm_map <- tm_shape(Bornholm) + tm_polygons() +
tm_layout(title = "Bornholm", frame = FALSE, bg.color = NA,
title.position = c("LEFT", "BOTTOM"))
mainland
print(Bornholm_map, vp = viewport(x = 0.35, y = 0.1, width = 0.2, height = 0.1))
This just rotates the plot with 90 dergrees and the island gets lost and I get this error message
Error in viewport(x = 0.35, y = 0.1, width = 0.2, height = 0.1) :
could not find function "viewport"
could not find function "viewport
. Also I am not able to install the packagespDataLarge
with my version ofr
. – xhr489 Jan 31 '19 at 8:59