[R] barchart producing incorrect number of barcharts when columns renamed

Deepayan Sarkar deepayan.sarkar at gmail.com
Thu Apr 26 21:27:52 CEST 2007


On 4/26/07, jim holtman <jholtman at gmail.com> wrote:
> Check you column names on the first plot.  You have two of them called
> "R Thalamus" and "R Mid Fron Gy".  This might be causing you problems.

Yes. Basically, rows/columns get converted to grouping variables with
levels given by the row/column names. E.g.,

> summary(barchart(errs.Means, groups = FALSE))

Call:
barchart.table(x = as.table(x), data = data, groups = FALSE)

Number of observations:
Var2
     R Cing Gy      R Smar Gy  L Inf Fron Gy     R Thalamus  R Mid Fron Gy
             3              3              3              6              6
 L Mid Temp Gy L Inf Par\nLbl      L Cing Gy R Mid Fron\nGy     R Lent Nuc
             3              3              3              3              3
 R Inf Fron Gy  R Mid Temp Gy  R Sup Par Lbl    R Cere\nTon         L Prec
             3              3              3              3              3
    R Cere Ton      L Pyramis      R Prec Gy
             3              3              3

This is probably slightly different from what you get because line
wrapping has made some names different that were actually the same.

By the way, you are using the 'groups' argument wrong; it can only be
a logical (see ?barchart.matrix).

-Deepayan



More information about the R-help mailing list