[R] (Small) problem with barchart

K. Elo maillists at nic.fi
Sun Feb 3 16:11:18 CET 2008


Hi,

I have a small problem when using barchart. I have the following data:

   letters  a
6        f 18
1        a 15
10       j 12
9        i 12
4        d  9
5        e  6

The data is from a survey and summaries the alternatives selected in one 
question. The idea is to have a bar chart illustrating the count of 
each selection in descending order. The data frame is already ordered 
in descending order. Thus, the chart _should_ look like this:
f |xxxxxxxxxxxxxxxxxx
a |xxxxxxxxxxxxxxx
j |xxxxxxxxxxxx
i |xxxxxxxxxxxx
d |xxxxxxxxx
e |xxxxxx

But if I use the command:
> barchart(DATA[[2]] ~ DATA[[1]])

The bars are displayed in alphabetical order.

How could I get the graph I would like to have? 

Thanks in advance & regards,
Kimmo

---
University of Turku, Finland
Dep. of political science



More information about the R-help mailing list