-1

I am using qplot in ggplot2 to plot two columns (a score from two tests) against eachother. this is fine. however when i add a third column saying which group each score came from (age group), I do not know how to plot a line for each group.

my data looks like:

test1     test2     age_band
-----     -----     --------

I currently have:

qplot(score1,score2,data=mydata,geom="smooth")

Looking at the qplot documentation it isn't clear to me that there is a parameter which can partition my plots using the age_band column.

How do I do this?

brucezepplin
  • 9,202
  • 26
  • 76
  • 129

1 Answers1

1

I believe that adding the group parameter to qplot should work perfectly.

qplot(score1,score2,data=mydata,group=age_band,geom="smooth")
thompsor
  • 149
  • 4