You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to migrate my tilegramsR package from sp to sf.
One of the operations I do is combine polygons by an attribute. I was using rmapshaper::ms_dissolve for it
Here's how it works in the old sp way of things
library(sp)
evs<-tilegramsR::Pitch_US_Population_2016_v1
class(evs)
plot(evs) # Each polygon is an electoral vote# Merge electoralvote polygons to state polygons using rmapshaperevs_states<-rmapshaper::ms_dissolve(evs, 'state')
plot(evs_states) # Each polygon is a state
Before Combining
After rmapshaper::ms_dissolve
I converted the evs to an sf object and then tried st_union after grouping by state, but I get some extra lines (see California, Florida states).
I'm trying to migrate my tilegramsR package from sp to sf.
One of the operations I do is combine polygons by an attribute. I was using
rmapshaper::ms_dissolve
for itHere's how it works in the old
sp
way of thingsBefore Combining
After
rmapshaper::ms_dissolve
I converted the
evs
to an sf object and then triedst_union
after grouping by state, but I get some extra lines (see California, Florida states).Full code is uploaded at Rpubs
The text was updated successfully, but these errors were encountered: