[R] another histogram question
niederlein-rstat at yahoo.de
Mon Sep 1 16:49:00 CEST 2008
Henrique Dallazuanna schrieb:
> You can do this:
> hh <- lapply(h, head, mh)
> hh$breaks <- head(h$breaks, mh + 1)
> class(hh) <- "histogram"
Thanks a lot, that's exactly what I need :-) (I did not consider the class...)
Putting an xlim could also be an solution but I think this is much more clean :-)
> On Mon, Sep 1, 2008 at 10:44 AM, Antje <niederlein-rstat at yahoo.de
> <mailto:niederlein-rstat at yahoo.de>> wrote:
> Hi there,
> I hope this question is not as stupid as the one before ...
> 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...
> h <- hist(data, plot=FALSE)
> mh <- 5
> hh <- list(h$breaks[0:(mh+1)],
> names(hh) <- names(h)
> R-help at r-project.org <mailto:R-help at r-project.org> mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
> Henrique Dallazuanna
> 25° 25' 40" S 49° 16' 22" O
More information about the R-help