[R] Multi-line graph?

William Revelle lists at revelle.net
Fri Oct 15 20:09:37 CEST 2010


?matplot

e.g.,

copy your data to the clipboard then

library(psych)
my.data <- read.clipboard()
>  my.data
    Tenth Fifth Third
GG   112   152   168
EC   100   120   140
SQ   160   184    NA
SK   120   100   180

matplot(t(my.data),type="b")

Bill



At 10:27 AM -0700 10/15/10, barnhillec wrote:
>Hi,
>
>I am relatively new to R but not to graphing, which I used to do in Excel
>and a few other environments on the job. I'm going back to school for a PhD
>and am teaching myself R beforehand. So I hope this question is not
>unacceptably ignorant but I have perused every entry level document I can
>find and so far I'm out of luck.
>
>I'm trying to graph some simple music psychology data. Columns are musical
>intervals, rows are the initials of the subjects. Numbers are in beats per
>minute (this is the value at which they hear the melodic interval split into
>two streams). So here's my table:
>
>  Tenth Fifth Third
>GG 112    152   168
>EC  100    120   140
>SQ  160   184    NA
>SK   120   100   180
>
>I want a multi-line graph where the intervals are on the X axis, and the y
>axis is the beats per minute, and each subject has a different line. In
>Excel this would be no problem but I am having trouble in R.
>
>The only way I can figure out how to plot this in R is if the columns or
>rows are taken as variables. But the variable is beats per minute. Any
>suggestions?
>
>I appreciate the help. -Eric
>--
>View this message in context: 
>http://r.789695.n4.nabble.com/Multi-line-graph-tp2997402p2997402.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list