[R] graphing with barchart question

Deepayan Sarkar deepayan.sarkar at gmail.com
Tue May 8 00:21:44 CEST 2007


On 5/7/07, Matthew Bridgman <m.bridgman at sbcglobal.net> wrote:
> 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?

This seems to work for me:

barchart(dv ~ factor(bins) | interaction(id, group),
         data = matt.df, groups = group,
         origin = 0, auto.key = list(columns = 2))

If you get the invalid line type thing, try upgrading R and lattice.

-Deepayan



More information about the R-help mailing list