Q: Is there an easy way to plot log histograms? The command "hist" draws a standard histogram with observed frequency on the y-axis. I would like to be able to draw the log frequency on the y-axis, but I can't see whether I can use "hist" for this. The purpose of such a plot is to see whether data are normal or Laplace or something else. - and the same question for kernel density estimates using "density". many thanks in advance Bent Nielsen --------------------------------------------------------- Dr Bent Nielsen University Lecturer in Econometrics, University of Oxford & Research Fellow, Nuffield College Mail: Nuffield College, Oxford OX1 1NF, UK Phone: +44 1865 278630 (Nuf) Phone: +44 1865 281289 (Dept) Fax: +44 1865 278621 (Nuf) Email: bent.nielsen at nuf.ox.ac.uk http://www.nuff.ox.ac.uk/users/nielsen -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, Oct 20, 2000 at 01:42:54PM +0100, Bent Nielsen wrote:> Q: Is there an easy way to plot log histograms? > > The command "hist" draws a standard histogram with observed frequency on the > y-axis. I would like to be able to draw the log frequency on the y-axis,Something like: > h <- hist(your.data,plot=F) > h$counts <- log(h$counts) #assuming no counts equal to 0 > plot(h,ylab="log(Frequency)")> > - and the same question for kernel density estimates using "density". >Same theme: > d <- density(your.data) > d$y <- log(d$y) > plot(d,ylab="log(density)",main="") guido (ps) Q: Where do h$counts and d$y come out? A: Look to str(h) and str(d). -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._