The function onverts SpatialLinesDataFrame to SpatialPointsDataFrame with points at the midpoints of the line segments.
A SpatialLines or SpatialLinesDataFrame object
The function builds a SpatialPointsDataFrame from the midpoints of Line objects belonging to Lines objects in an object inheriting from a Spatial Lines object. The output data slot contains an index variable showing which Lines object the midpoints belong to.
A SpatialPointsDataFrame object created from the input object.
Jonathan Callahan, modified by Roger Bivand
1 2 3 4 5
Loading required package: sp Checking rgeos availability: FALSE Note: when rgeos is not available, polygon geometry computations in maptools depend on gpclib, which has a restricted licence. It is disabled by default; to enable gpclib, type gpclibPermit() Warning message: readShapeLines is deprecated; use rgdal::readOGR or sf::st_read
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.