How to use the log scale for the y axis of a histogram in R?

I have a large dataset with thread durations on a discussion board. I want the histogram to show the distribution of life expectancy, so I did this:

dall <- read.csv("lifespan.csv") colnames(dall) <- c("thread.id", "seconds.alive", "start.time") hist(dall$seconds.alive) 

which generated this hard to read image: http://dl.dropbox.com/u/285483/tmp/screenshot297.png

My questions are: a) changing the y axis to a logarithmic scale - a good way to make it more readable? Apparently, some people think this is a bad idea to change the y axis to a log.

b) how to do it?

+2
source share
1 answer

Instead, I will try to use hist(log10(dall$seconds.alive)) .

Also try specifying breaks=100 or less / more:

 hist(log10(dall$seconds.alive), breaks=100) 
+4
source

All Articles