[R] visualizing frequencies

From: Mag. Ferri Leberl <ferri.leberl_at_gmx.at>
Date: Sun 26 Jun 2005 - 22:55:13 EST

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? Thank you in advance!

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jun 26 23:03:04 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:02 EST