[R] Is ther a possibility to display the log(frequency) instead of the frequency in the hist plot?

Alexander A. Morgan amorgan at linus.mitre.org
Thu Jan 18 20:05:04 CET 2001


I imagine that the point of logging the histogram count axis is just for
displaying purposes, and your suggestion would alter the scale.  I find it
easier to just leave the 0 counts as zero.

hist(my.data, plot=F)$counts -> my.hist.counts;
my.hist.counts[my.hist.counts != 0] <- 
                      log(my.hist.counts[my.hist.counts!= 0]);
plot(my.hist.counts, type="hist");


-Alex Morgan

Phone: 781-271-6306                       "They laughed at Newton.
Office: 3K-136                            They laughed at Einstein.
AOL Instant Messenger: HomeySage          But they also laughed at Groucho
                                          Marx."
                                                      --Carl Sagan

On Thu, 18 Jan 2001, Peter Kleiweg wrote:

> Witold Eryk Wolski skriver...
> 
> > Some questions still remain to me.
> > 1. How take an log if one of the my.hist$counts equals 0?
> 
> log(my.hist$counts + 1)
> 
> -- 
> Peter Kleiweg
> http://www.let.rug.nl/~kleiweg/
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list