R:获取离群值的索引值的数据帧
我有一个包含 170 个变量的数据集,第一个是客户 ID,我将其转换为数据框的索引:
input2 <- data.frame(input2[,-1], row.names = input2[,1])
我已经找到了异常值:
outliers <- boxplot(input2)$out
但现在我想创建一个数据框,其中我有被视为异常值的客户 ID。由于“异常值”的输出是一个列表,我怎样才能得到这个?
编辑:我尝试过
which(input2 %in% outliers)
,但它给出了“integer(0)”作为输出
谢谢
I have a dataset with 170 variables and the first one is Customer ID which I converted as index of the data frame:
input2 <- data.frame(input2[,-1], row.names = input2[,1])
I already found the outliers:
outliers <- boxplot(input2)$out
but now I want to create a data frame where I have the Customer ID that are considered outliers. How can I get this since the output of "outliers" is a list?
Edit: I tried
which(input2 %in% outliers)
but it gives "integer(0)" as output
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论