2011年5月26日星期四

which(), any(), apply() - three R functions

The following codes just show you the R functions: which(), apply(), and any().

library(kinship)

data(BTped)

head(BTped)

Nped <- BTped[which(apply(BTped, 1, function(x) { any(x == "R187920" | x == "R187921")  })), ]

Nped

没有评论:

发表评论