I am graphing data using barchart (barchart(DV ~ IV | subject). I have 2 groups of 9 subjects each. How can I easily identify which group each subject belongs to? I have been trying to color code them, but can't seem to get that to work. Any suggestions would be appreciated. Thanks, Matt Bridgman
On 5/7/07, Matthew Bridgman <m.bridgman at sbcglobal.net> wrote:> I am graphing data using barchart (barchart(DV ~ IV | subject). I > have 2 groups of 9 subjects each. How can I easily identify which > group each subject belongs to? I have been trying to color code them, > but can't seem to get that to work. Any suggestions would be > appreciated.Not sure what you are looking for (is your "group" one of DV and IV, or is it something entirely different?). A reproducible example would have helped, but try looking at ?panel.barchart and use the 'groups' and 'stack' arguments. -Deepayan
Sorry. I have attached my data frame: DV = dv; IV = bins; subject = id, Group = group. barchart(dv ~ bins | id + group, groups = group, data = matt.df) The two suggestions you offered give me error messages regarding invalid line type and do not plot all of the data. If I drop the 'groups' argument I get all of the data, but it plots all combinations of group and id (yielding 36 plots instead of 18). Is there a way to eliminate some of the combinations? Thanks again for your help. Matt -------------- next part --------------> > It doesn't have to be, you can do > > barchart(DV ~ IV | subject + Group, groups = Group) > > or > > barchart(DV ~ IV | subject:Group, groups = Group, auto.key = TRUE) > > Of course, I can't check this because you still haven't given me a > reproducible example (and please CC r-help so that follow ups remain > archived). > > -Deepayan