[R] How may I add "is.outer" method

andrew andrewjohnroyal at gmail.com
Sun Apr 12 14:29:55 CEST 2009


I am not quite sure how you define your outlier, but the definition
that I am familiar with is that an outlier is greater than 1.5*Inter
quartile range above the 3rd quartile or below the 1st quartile (this
is the default for the whiskers in boxplot).  This can be easily found
by

  x[(x < quantile(x)[2] - 1.5*IQR(x)) | (x > quantile(x)[4] + 1.5*IQR
(x))]

or if you prefer

  is.outlier <- function(x) {(x < quantile(x)[2] - 1.5*IQR(x)) | (x >
quantile(x)[4] + 1.5*IQR(x))}
  x[is.outlier(x)]

HTH.

Andrew.


On Apr 12, 8:51 am, Grześ <gregori... at gmail.com> wrote:
> Hello
> I have a problem like this:
>
> > Glass$RI[is.outlier(Glass$RI)]
>
> Error: could not find function "is.outlier"
>
> Which commend I may add "is.outer" to my application?
>
> --
> View this message in context:http://www.nabble.com/How-may-I-add-%22is.outer%22-method-tp23006216p...
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list