# [R] visualizing frequencies

Mag. Ferri Leberl ferri.leberl at gmx.at
Sun Jun 26 14:55:13 CEST 2005

```Dear everybody,

In our game-theory lesson we have run several classroom-experiments where the
students had to decide for a natural number between one and seven. I have
troubles now to visualize the results: be a the vector of answers.

hist(a) will not assume natural numbers as answers, but rational. It will make
the brakes exactly at the natural numbers,  which is difficult to interpret,
as only natural numbers may be employed.

barplot(a) or barplot(a,1:7) will not aggregate the answers. If three students
returned the number seven, it will show three bars to the size of seven
instead one bar to the size of three on index seven.

barplot(1:7,a), in this case, will show the bar at index seven, wut it will be
to the hight of seven and to the width of three.

I also wanted to show the results of the different versions of the experiment
in ONE plot. As the number of participants varied I googled around in the
R-Archives and got to recognize plot.edf. As a pitty, this function seems to
set the index the wrong way round: the function starts with the number of
students deciding for seven, but indexes them with one.

Can anybody help me with these two problems?