Skip to content
Prev 43472 / 398506 Next

in which column is an entry?

Christian Schulz wrote:
I am not sure, but I think you might want something like this:

t1 <- apply(df, 1, function(x){
             ifelse(all(is.na(x)) | all(na.omit(x) < 0),
             NA, which(x >= 0))})

hope this helps,

Chuck Cleland