Skip to content
Prev 374496 / 398513 Next

Dinamic variables in loop

Hello,

I am a newbie in R and I have a problem.
I want this line:

newMyData <-MyData[!(is.na(col1)) | !(is.na(col2)) | !(is.na(col3)) | !(
is.na(col4)) | !(is.na(col5)),]

write in for loop. The number of col[number] may be different from 3 to 8

Is there any ideas?

Thank you
Laura