# 中位数替换
data[which(is.na(data$decisionhabit_user)),] <- median(data$decisionhabit_user, na.rm = TRUE)
# 数值0替换
data[which(data$historyvisit_7ordernum == 'NULL'), 7] <- 0
# 中位数替换
data[which(is.na(data$decisionhabit_user)),] <- median(data$decisionhabit_user, na.rm = TRUE)
# 数值0替换
data[which(data$historyvisit_7ordernum == 'NULL'), 7] <- 0
本文标题:R 使用指定值替换缺失值
本文链接:https://www.haomeiwen.com/subject/hawazftx.html
网友评论