[R] changing the index of a histogram

From: Mag. Ferri Leberl <ferri.leberl_at_gmx.at>
Date: Thu 21 Sep 2006 - 18:28:03 GMT


Dear everybody!
I am trying to make up a histogram of marks of a recent test I have corrified.
Say I have a vector "points" and a vektor "breaks" to segregate the marks. Finally there is a vector "marks".

hist(points, breaks=breaks) leaves me with two problems: At first the width of the bars of the histogram corresponds with the width of the intervall. This will look confusing and not very elaborated when in the end the index shall not be "breaks", but "marks". At second, you guessed it, I have the problem to exchange "breaks" for
"marks" on the y-axis, at least surfacially.
A glance into old mailing list brought me plot(table(cut(points,breaks=breaks,right=FALSE,include.lowest=TRUE))) as a good solution to the first matter (except that right=FALSE seems contradictory ;)
I would be very glad if you could give me a hint to solve the second problem, most preferably such, that the first would be circumvaded by transforming the variable intervals of "breaks" into the uniform ones of
"marks" and then employing hist().

Thank you in advance.
Yours,
Mag. Ferri Leberl



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 and provide commented, minimal, self-contained, reproducible code. Received on Fri Sep 22 05:04:02 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 21 Sep 2006 - 19:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.