79270475

Date: 2024-12-11 04:39:14
Score: 1
Natty:
Report link

One of the main issues is that you have to use a UTM projection. Answers to this similar question offer a lot more detail. Here are two possible solutions to your issue based on these answers (including the use of a relevant UTM code):

Create a buffer of 0 units around regions to remove the inner border

regions %>%
st_buffer(0) %>%
st_transform(crs='EPSG:32704') %>%
ggplot() +
  geom_sf(fill = 'lightgrey', linewidth = 1)

plot using buffer of 0 units

Or you could use the ms_dissolve() function from the rmapshaper package

library(rmapshaper)

regions %>%
st_transform(crs='EPSG:32704') %>%
rmapshaper::ms_dissolve() %>%
ggplot() +
  geom_sf(fill = 'lightgrey', linewidth = 1)

plot using rmapshaper package

The second image looks more like what you are looking for. Keep in mind though that this solution uses UTM Zone 4. Most of the State of Hawaii is in this zone, but a majority of the Island of Hawaii (the easternmost island) is in UTM Zone 5.

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Stephen C. Sanders