R tmap:如何调整图例框线宽

R tmap: How to adjust the legend frame line width

我正在尝试使用酷炫的 tmap 包制作地图,但我不知道如何调整图例框线宽。我检查了令人印象深刻的 tm_layout 参数列表,但我发现最接近的是 frame.lwd 但是,它指的是地图的框架。我用 legend.frame.lwd 进行了猜测,但未定义。这是一个玩具示例:

library(tmap)
data(Europe)

tm_shape(Europe) +
  tm_polygons("well_being", textNA="Non-European countries", title="Well-Being Index") +
  tm_text("iso_a3", size="AREA", root=5) +
  tm_layout(legend.position = c("RIGHT","TOP"),
            legend.frame = TRUE,
            frame.lwd = 5) # legend.frame.lwd does not exist

tmap 的较新版本中,参数 legend.frame.lwd 包含在 this commit 中。这是一个示例,使用 tmap 2.2 版:

library(tmap)
data("World")

tm_shape(World) +
  tm_polygons("HPI") +
  tm_layout(legend.frame = TRUE,
            frame.lwd = 5,
            legend.frame.lwd = 5)