geofacet
geofacet copied to clipboard
NA values would break the code
Hi,
If state
has NA
, it would break the code. Here I use the following example to illustrate it:
read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-02-08/airmen.csv') %>%
count(state, pilot_type, rank_at_graduation, sort = T) %>%
#filter(!is.na(state)) %>%
ggplot(aes(n, pilot_type, fill = rank_at_graduation)) +
geom_col() +
facet_geo(~ state, scales = "free_y")
The code breaks with the confusing error message ! The given dimensions cannot hold all panels. Please increase ncol or nrow
, but when you uncomment the filter()
line, it works. Not sure if this is bug, but I think it's worth mentioning.