我在 Windows 10 上使用 R(x64 版本 3.2.2)并在(见下文)尝试对具有许多 NA 的非常简单的数据帧进行子集化时收到以下错误消息。
dt <- read.table("Datos.csv", header=T, sep=",")
k1 <- which(apply(is.na(dt),2,sum) < 10) #Keep variables with <10 NA's
k2 <- which(apply(is.na(dt[,k1]),1,sum)==0) #Keep observations with no NA's
dt <- dt[k2,k1]
Error in dt[k2, k1] : object of type 'closure' is not subsettable
在我的情况下,这个错误的原因是什么?
最好的。卢西亚诺