Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Line

create objects of class Line or Lines


Description

create objects of class Line or Lines from coordinates

Usage

Line(coords)
Lines(slinelist, ID)

Arguments

coords

2-column numeric matrix with coordinates for a single line

slinelist

list with elements of class Line-class

ID

a single word unique character identifier, character vector of length one

Value

Line returns an object of class Line-class; Lines returns an object of class Lines-class

See Also

Examples

# from the sp vignette:
l1 = cbind(c(1,2,3),c(3,2,2))
l1a = cbind(l1[,1]+.05,l1[,2]+.05)
l2 = cbind(c(1,2,3),c(1,1.5,1))
Sl1 = Line(l1)
Sl1a = Line(l1a)
Sl2 = Line(l2)
S1 = Lines(list(Sl1, Sl1a), ID="a")
S2 = Lines(list(Sl2), ID="b")

sp

Classes and Methods for Spatial Data

v1.4-5
GPL (>= 2)
Authors
Edzer Pebesma [aut, cre], Roger Bivand [aut], Barry Rowlingson [ctb], Virgilio Gomez-Rubio [ctb], Robert Hijmans [ctb], Michael Sumner [ctb], Don MacQueen [ctb], Jim Lemon [ctb], Finn Lindgren [ctb], Josh O'Brien [ctb], Joseph O'Rourke [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.