-1

I have lots of coordinate vectors like that

x1<-c(1,2,4,5,6,7,8,9)
y1<-c(1,2,3,4,5,6,7,8)
x2<-c(1,2,3,4,5)
y2<-c(3,4,5,6,2)

I want to make a lines graph

David Arenburg
  • 91,361
  • 17
  • 137
  • 196
Lee Leon
  • 1
  • 1
  • Could you please elaborate more your question? – abarisone Mar 23 '15 at 08:31
  • You can use `plot(..., type = "n")` and add each line using `lines` function. Alternatively, if you want to use ["dazzling" graphics](http://docs.ggplot2.org/current/geom_line.html), you can manipulate your data into a data.frame where each line holds a value and from where it came from ("x1"). – Roman Luštrik Mar 23 '15 at 08:32
  • possible duplicate of [Plot multiple lines (data series) each with unique color in R](http://stackoverflow.com/questions/14860078/plot-multiple-lines-data-series-each-with-unique-color-in-r) –  Mar 23 '15 at 09:04

1 Answers1

0

This should be quite simple, you could try this;

    plot(y1 ~ x1, type = "l")

Then you can add the rest of the lines with;

    lines(y2 ~ x2)
roman
  • 1,340
  • 9
  • 33