I have a data.mat matrix that looks like this:
ABCDE 45 43 45 65 23 12 45 56 NA NA 13 4 34 12 NA
I am trying to turn this into a list of lists, where each row is one list in a larger list. I do the following:
list <- tapply(data.mat,rep(1:nrow(data.mat),ncol(data.mat)),function(i)i)
which gives me a list of lists with NA enabled, for example:
$`1` [1] 45 43 45 65 23 $`2` [1] 12 45 56 NA NA $`3` [1] 13 4 34 12 NA
But I want:
$`1` [1] 45 43 45 65 23 $`2` [1] 12 45 56 $`3` [1] 13 4 34 12
Is there a good way to remove NS during a call or after a fact?
source share