Q:

if not na in r

> which( !is.na(p), arr.ind=TRUE)
     row col
[1,]   1   2
[2,]   1   3
[3,]   2   4
[4,]   4   5
[5,]   2   7
0
lapply(apply(p, 1, function(x) which(!is.na(x)) ) , paste, collapse=", ")
0
> apply(p, 1, function(x) which(!is.na(x)) )
[[1]]
[1] 2 3

[[2]]
[1] 4 7

[[3]]
integer(0)

[[4]]
[1] 5

[[5]]
integer(0)
0
which( !is.na(p), arr.ind=TRUE)
0

New to Communities?

Join the community