这个是我从原始数据中截取出来的,需要对于不同性别(A_sex)剔除能量(f_en)摄入异常的行
代码如下:
hyper$NL<-1
hyper$NL[hyper$A_sex=="1"&(hyper$f_en>"6000"|hyper$f_en<"800")]<-2
hyper$NL[hyper$A_sex=="2"&(hyper$f_en>"4000"|hyper$f_en<"600")]<-2
del <- which(hyper$NL=="2")
hyper1 <- data[-del,]
Error in data[-del, ] : object of type 'closure' is not subsettable
str(hyper$NL)
num [1:299] 1 2 2 2 2 2 2 2 2 2 ...
问题1:报错 Error in data[-del, ] : object of type 'closure' is not subsettable
问题2:肉眼对照原始数据,对能量比较的判断完全不对,
希望各位朋友
能够解惑,为啥数字比较出来的结果完全不对呀