如何在R中的箱线图中删除异常值? [英] How to remove outliers in boxplot in R?

查看:808
本文介绍了如何在R中的箱线图中删除异常值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

在方框图中更改异常值规则

我需要使用箱线图可视化我的结果。

I need to visualize my result using box-plot.

x<-rnorm(10000)
boxplot(x,horizontal=TRUE,axes=FALSE)

如何在可视化过程中过滤异常值?

How can i filter outliers during visualisation?

(1)这样,我可以在屏幕上显示完整图像,而不会出现难看的异常值。

(1) So that i can have full image on screen without having ugly outliers.

http://postimage.org/image / szzbez0h1 / a610666d /

(2)有什么方法可以显示离群值到一定范围的异常值?
http://postimage.org/image/np28oee0b/8251d102/

(2) Is there any way to show outliers upto certain range? http://postimage.org/image/np28oee0b/8251d102/

注意事项

推荐答案

请参见?boxplot 为您提供所有需要的帮助。

See ?boxplot for all the help you need.

 outline: if ‘outline’ is not true, the outliers are not drawn (as
          points whereas S+ uses lines).

boxplot(x,horizontal=TRUE,axes=FALSE,outline=FALSE)

并用于扩大晶须的范围并抑制该范围内的异常值:

And for extending the range of the whiskers and suppressing the outliers inside this range:

   range: this determines how far the plot whiskers extend out from the
          box.  If ‘range’ is positive, the whiskers extend to the most
          extreme data point which is no more than ‘range’ times the
          interquartile range from the box. A value of zero causes the
          whiskers to extend to the data extremes.

# change the value of range to change the whisker length
boxplot(x,horizontal=TRUE,axes=FALSE,range=2)

这篇关于如何在R中的箱线图中删除异常值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆