Skip to content
Prev 65245 / 398506 Next

barchart error (invalid line type) maybe caused by mangled data frame, & fix() resolving the problem

Hi,

I use R 2.0.1 at WinXP. I ran into the following problem when using 
barchart() and would like to ask if there is a solution for it other 
than using fix().

My data is:
or simply:

 > b
     uint uext uges month year
1     84   17  101    01   02
11    42   12   54    02   02
12    71   13   84    03   02
13    82   17   99    04   02
14    80   14   94    05   02
15   123   32  155    06   02
16    13   34   47    07   02
17     1    5    6    08   02
18    15   50   65    09   02
19    77  132  209    10   02
110   61   93  154    11   02
111   56   66  122    12   02
112   62   86  148    01   03
113   27   66   93    02   03
114  100   65  165    03   03
115   87   63  150    04   03
116  110   54  164    05   03
117  191   97  288    06   03
118   71   34  105    07   03
119    3   41   44    08   03
120   48   81  129    09   03
121  144  123  267    10   03
122  101   88  189    11   03
123  115   85  200    12   03
124  161  213  374    01   04
125   52  159  211    02   04
126  164  171  335    03   04
127  105  158  263    04   04
128  154  140  294    05   04
129  266  153  419    06   04
130   93   75  168    07   04
131    1   65   66    08   04
132   53  126  179    09   04
133  167  252  419    10   04
134  161  225  386    11   04
135  130  127  257    12   04
136  195  192  387    01   05

What I would like to do is this: display a bar chart uint per month with 
the values per year stacked. So I type:
The trellis window pops up and I after drawing one bar I get this error 
message:
I tried several things to resolve the problem. Rather by accident I typed:
After trying the barchart() function again, it was properly displayed.

I guess that the data.frame is somehow messed up during the aggregation 
procedure, which didn't cause any problems so far, and that fix() 
somehow puts things right again. Now, is there a non-interactive 
solution for this problem? Does anybody know what caused this problem in 
the first place?

The data is read from a bundle of csv files using this function:
> b <- bb$all
I'm (still) new to R, so I guess there are more appropriate ways to 
collect the data.

Regards,
Thomas.