I'm new with R. I want to plot 3 lines in one graph. This is my data:print(x) V1 V2 V3 V4 1 -4800 25195.73 7415.219 7264.28 2 -2800 15195.73 5415.219 7264.28--x$V1 Is the vector of coordinates for the horizontal axis and V2, V3, V4 the vectors for the vertical.I would like to make the lines extend so I can see the intersections.From what I understand from this example I would need to reshape my data to something like thisid x y 1 1 -4800 25195.73
2 1 -2800 15195.73 3 2 -4800 7415.2194 2-28005415.219 5 3 -4800 7264.28 6 3-2800 7264.28
Is this right? Can somebody explain me how to do it?Thanks a lot for the help!
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Yes. Use melt() from the reshape package.
melt(x, id.var = “h”, measure.var = c(“FT”, “PT”, “NW”))
or if x contains only those 4 variables
melt(x, id.var = “h”)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey