Skip to content

Commit

Permalink
Merge branch 'hexisticker-regions' of https://github.com/RichardMN/co…
Browse files Browse the repository at this point in the history
…vidregionaldata into hexisticker-regions
  • Loading branch information
RichardMN committed Jun 20, 2021
2 parents 57d20c9 + a137ddf commit 88f7116
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions inst/make_hexsticker.R
Expand Up @@ -20,8 +20,15 @@ regional_countries_l2 <- regional_countries %>%
filter(!(is.na(.data$level_2_region)))

# get world data
world <- spData::world %>%
st_as_sf()
world <- ms_simplify(spData::world %>%
st_as_sf(), keep = 0.04)

regional_maps <- ms_simplify(ne_states(gsub(' \\(.*\\)', "", regional_countries$origin,perl=TRUE),
returnclass = "sf"), keep = 0.04) %>%
mutate(
region_code = paste("Level", woe_id %% 7 + 3)
)


world_without_regions <- ne_countries(returnclass = "sf") %>%
filter(sovereignt != "Antarctica")
Expand All @@ -35,7 +42,7 @@ regional_maps <- ms_simplify(ne_states(gsub(' \\(.*\\)', "", regional_countries$
countryname(regional_countries_l2[["origin"]], destination = "country.name.en"),
0, 7)
)


# mark supported countries from the world data
supported_countries <- world %>%
Expand Down

0 comments on commit 88f7116

Please sign in to comment.