[R] Help with Hist

Ben Bolker bbolker at gmail.com
Mon Nov 15 16:30:21 CET 2010


Steve Sidney <sbsidney <at> mweb.co.za> writes:

> I am trying to re-scale a histogram and using hist() but can not seem to 
> create a reduced scale where the upper values are not plotted.
> 
> What I have is about 100 of which 80 or so are between a value of 0 and 
> 40 , one or two in the hundreds and an outlier around 2000.
> 
> If I use breaks c(0, 20, 40, 60, 80, 100, 200, 500) R gives me an error 
> saying that there are values not included, which of course I know but I 
> wish to ignore them.

  Subset your data first to remove the outlier?

x.trimmed <- x[x<2000]

or

x.trimmed <- subset(x,x<2000) 

?



More information about the R-help mailing list