# \donttest{
# Create a data frame defining three lines
lns <- data.frame(
xs = c(1, 2, 3), ys = c(1, 1, 1), # start points
xe = c(2, 3, 4), ye = c(2, 2, 2)
) # end points
# Conversion to SpatialLinesDataFrame without CRS
spl <- sline(lns,
start.cols = c("xs", "ys"),
end.cols = c("xe", "ye")
)
if (require(ggplot2, quietly = TRUE)) {
# Plot the lines
ggplot() +
gg(spl)
}
# }
Run the code above in your browser using DataLab