When running tm_facets() with both drop.units = FALSE and drop.NA.facets=TRUE, I get an error message:
Error in legs_aes$legend[[1]] : subscript out of bounds
In addition: Warning message:
In set(x, j = name, value = value) :
Column 'vneutral' does not exist to remove
it seems that there is a conflict in these two options?
library(tmap)
#>
#> Attaching package: 'tmap'
#> The following object is masked from 'package:datasets':
#>
#> rivers
# Load the World dataset
data(World)
World2 <- World
World2$continent <- ifelse(sample(c(TRUE, FALSE), nrow(World2), TRUE),
NA_character_,
as.character(World$continent))
tm_shape(World2) +
tm_borders() +
tm_fill("pop_est") +
tm_facets(by = "continent", drop.units = FALSE, drop.NA.facets=TRUE)
#> Warning in set(x, j = name, value = value): Column 'vneutral' does not exist to
#> remove
#> Error in legs_aes$legend[[1]]: subscript out of bounds
When running
tm_facets()
with bothdrop.units = FALSE
anddrop.NA.facets=TRUE
, I get an error message:it seems that there is a conflict in these two options?
Created on 2024-09-03 with reprex v2.1.1