jeudi 2 février 2017

Converte rows to "NA" if numeric rowsum threshold is not reached

I am trying to quickly convert a complete row of data to NAs if the rowsum does not reach a certain value. I could simply delete the whole row using

MINSIZE = 100
x = x[which(rowSums(x) <= MINSIZE)

but that would screw up calculations further down the line. Any suggestions?

Best, Leon

Aucun commentaire:

Enregistrer un commentaire