#' @发现有NA值-使用均值替换 sum(is.na(train)) #' @循环使用均值来代替每列的缺失值 for(i in 2:ncol(train)){ train[is.na(train[,i]),i]<-mean(train[!is.na(train[,i]),i]) }
df[!complete.cases(df),] summary(df)