I have a road network as an sf layer in R. I would like to check and correct its topology so that all dangles are removed, undershoots are extended, and all intersections happen at a vertex. Only genuine dead-ends (cul-de-sacs) will be maintained and they have been defined as the road segment that ends at a distance more than 500m from a vertex. By googling around, I am only seeing codes like this:
roads %<>% st_make_valid(geos_method = "valid_structure", geos_keep_collapsed = F)
In this code, I don't have an option to define these rules I want to enforce. Are there other packages that can better serve my purpose? How?