Thank you for your answers, I have another question: the behaviour of setdiff(indicesFalse, indicesNA) does not seem predictable to me.
> indices [1] 1 2 3 4 5 6 > compareVector [1] NA TRUE TRUE TRUE FALSE NA > indicesNA = indices[is.na(compareVector)] > indicesNA [1] 1 6 > indicesFalse = indices[compareVector == FALSE] > indicesFalse [1] NA 5 NA > setdiff(indicesNA, indicesFalse) ######################## OK [1] 1 6 > setdiff(indicesFalse, indicesNA) ######################## I would > expect here 'NA 5 NA' [1] NA 5 > -- Svetlana Eden Biostatistician II School of Medicine Department of Biostatistics Vanderbilt University ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html