See below - I don't understand this behaviour. I can successfully filter by region
, but not by subregion
. This happens both with and without fortifying the object WorldData1
. It also saves like this to file. Any ideas?
library(tidyverse)
WorldData1 <- map_data('world') %>% filter(subregion != '')
# I am using no characters as filter, but this also happens when putting in a subregion, e.g. 'Alaska'
#>
#> Attaching package: 'maps'
#> The following object is masked from 'package:purrr':
#>
#> map
ggplot() +
geom_map(data = WorldData1, map = WorldData1,
aes(x = long, y = lat, map_id = region))
#> Warning: Ignoring unknown aesthetics: x, y
Created on 2019-05-12 by the reprex package (v0.2.1)
devtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#> setting value
#> version R version 3.5.3 (2019-03-11)
#> os macOS Mojave 10.14.3
#> system x86_64, darwin15.6.0
#> ui X11
#> tidyverse * 1.2.1 2017-11-14 [1] CRAN (R 3.5.0)