Description Usage Arguments Examples
This function converts a dataframe of IDs and coordinates into a SpatialLines object of the package "sp".
1 | linedf2SpatialLines(linedf)
|
linedf |
a data frame with the following columns: id = generic ids of the lines, fx = coordinates x of the first point of the line, fy = coordinates y of the first point of the line, tx = coordinates x of the second point of the line, tx = coordinates y of the second point of the line. |
1 2 3 4 | library("sp", "sptools")
sl = linedf2SpatialLines(data.frame(id=1, fx=0, fy=0, tx=2, ty=2))
class(sl)
plot(sl)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.