-5
从这个例子:提取不完整的情况下,从数据集R中
## x
## v1 v2 v3
##1 90 55 NA
##2 NA 45 8
##3 85 NA 5
##4 NA 33 7
##5 55 30 4
##6 60 20 3
##7 75 15 2
##8 80 23 6
# ici is where Incomplete case indicator
ici=(function (x)
return(is.na(x)))
ici(x)
v1 v2 v3
## [1,] FALSE FALSE TRUE
## [2,] TRUE FALSE FALSE
## [3,] FALSE TRUE FALSE
## [4,] TRUE FALSE FALSE
## [5,] FALSE FALSE FALSE
## [6,] FALSE FALSE FALSE
## [7,] FALSE FALSE FALSE
## [8,] FALSE FALSE FALSE
# Extracts incomplete cases from a data set
ic=(function (x, drop)
return(x[ici(x)]))(x, drop)
ic(x)
## Error: could not find function "ic"
从上次运行(错误:无法找到函数“IC”)为什么给我这个,我该如何解决这个broblem与功能ic
但给我这个'假假假假真真真真的'但是我想提取包含NA – user5934339
所有实例但我想解决我的功能问题我的意思是(ic) – user5934339
[使用正确的R表示法来创建函数](http://www.statmethods.net/management/userfunctions.html)。现在的问题是:你想要“放下”做什么?你为什么不想使用'complete.cases'? – Therkel