[R] another histogram question

Marianne Promberger mpromber at psych.upenn.edu
Mon Sep 1 16:15:32 CEST 2008


> I tried to shorten my histogram (because the distribution is quite skewed 
> and I simply don't want to see the long tail but still use the histogram 
> plot). How can I do something like this? (The example does not work but I 
> don't know why...)
>
> data <- rnorm(100) # as example, of course this is not skewed...


Hmm not sure if this is what you want, but maybe subset the data:

hist(data[data > -1])

m.

>
> h <- hist(data, plot=FALSE)
> mh <- 5
> hh <- list(h$breaks[0:(mh+1)], 
> h$counts[0:mh],h$intensities[0:mh],h$density[0:mh],h$mids[0:mh],h$xname,h$equidist)
> names(hh) <- names(h)
> plot(hh)
>
>
> Antje
>
> ______________________________________________
> R-help at r-project.org 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.
>

-- 
Marianne Promberger
Graduate student in Psychology
http://www.psych.upenn.edu/~mpromber



More information about the R-help mailing list