美文网首页
数据框去除离群点

数据框去除离群点

作者: F_U_N | 来源:发表于2018-03-10 13:54 被阅读0次

getwd()
setwd("E:/fanyixian/data")
m1 <- read.table("XXX.txt",header = F)

for (i in 1:nrow(m1)){
motif_1[i,m1[i,58:1057] %in% boxplot.stats(as.numeric(motif_1[i,58:1057]),coef = 4)$out] <- NA
}

kmeans

n <- c(1:nrow(motif_1))
pw <- NULL
for (i in n){
pw[i] <- wilcox.test(as.numeric(motif_1[i,58:207]),as.numeric(motif_1[i,208:1057]),alternative = "greater",na.omit = T)$p.value
}
head(pw)
length(na.omit(pw))
motif_1[1,200:300]
test <- kmeans(motif_1[58:1057],3)$cluster
table(test)
test_result <- which(test == 3)

test1 <- kmeans(motif_1[58:1057],2)
test1 <- test1$cluster
table(test1)

相关文章

网友评论

      本文标题:数据框去除离群点

      本文链接:https://www.haomeiwen.com/subject/efuvfftx.html