更新时间:2023-02-18 10:11:48
让 dat
成为数据框,并且 cols
列名称向量或列号码。然后你可以使用
Let dat
be a data frame and cols
a vector of column names or column numbers of interest. Then you can use
dat[!rowSums(is.na(dat[cols])), ]
排除所有行至少有一个 NA
。
to exclude all rows with at least one NA
.