Big thanks to author, but an error ocurred to me when select biggest polygon , I don’t know if it is due to different version of packages. the error is below : error in evaluating the argument ‘x’ in selecting a method for function ‘as.lines’: Problem with mutate() column area. ℹ area = expanse(exploded). ℹ area must be size 0 or 1, not 759. Caused by error in abort_glue():
But it works to me with modifying original code like this: exploded$area = expanse(exploded) r_plain <-exploded %>% filter(area > 50000**2) %>% # And convert to lines as.lines()