Learn R Programming

stplanr (version 0.1.4)

points2line: Convert a series of points, or a matrix of coordinates, into a line

Description

This is a simple wrapper around spLines that makes the creation of SpatialLines objects easy and intuitive

Usage

points2line(p)

Arguments

p
A SpatialPoints obect or matrix representing the coordinates of points.

Examples

Run this code
p = matrix(1:4, ncol = 2)
l = points2line(p)
plot(l)
l = points2line(cents)
plot(l)
p = line2points(routes_fast)
l = points2line(p)
plot(l)

Run the code above in your browser using DataLab