[R] having scaling problems with a histogram

Marc Schwartz (via MN) mschwartz at mn.rr.com
Thu Oct 20 22:29:59 CEST 2005

On Thu, 2005-10-20 at 17:31 +0200, Christian Jones wrote:
> Hello,<?xml:namespace prefix = o ns =
> "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
> I would like to create a histogram from a data collumn consisting of 4
> classes (0; 0.05;0.5;25;75). Due to the difference in scale the
> classes 0;0.05 and 0.5 are displayed within one combined bin by
> default with the code:Hist(x, scale="percent", breaks="Sturges"). How
> can I display them all, or as unique classes, leaving out the rest of
> the x_axes scale? There was no enlightenment in the help function and
> the command : breaks=5 did not do the trick.<o:p></o:p>
> Thanks in advance <o:p></o:p>
> Chris<o:p></o:p>

I may be mis-understanding what you are doing here, but it sounds like
you should be using barplot() rather than hist(), which is referenced in
the "See Also" in ?hist. This would be preferred if you want individual
counts or proportions (or percents) from specific groups without

Where does the 'scale = "percent"' come from?  I don't recognize that
argument from the standard histogram plotting functions. 

Oh, wait a minute, just found it doing a search. The Hist() function is
in John Fox's Rcmdr. Please be sure to note this if you are using a
function from a contributed package. It saves time and increases the
likelihood of your getting a reply.

Also, I am guessing that the extraneous content here is the result of
using MS Word as your e-mail editor? Please use plain text only, which
is the defined format for this list and from reviewing the archive, has
been pointed out to you previously by Frank Harrell and Ted Harding.


Marc Schwartz

More information about the R-help mailing list