[R] assign NA to rows by test on multiple columns of a data frame
massimo.bressan at arpa.veneto.it
Wed Nov 22 11:34:50 CET 2017
Given this data frame (a simplified, essential reproducible example)
mydf<-data.frame(A, A_flag, B, B_flag)
# this is my initial df
I want to get to this final situation
# this is my final df
By considering that I have to perform this task in a data frame with many columns I’m wondering if there is a compact and effective way to get the final result with just one ‘sweep’ of the dataframe?
I was thinking to the function apply or lapply but I can not properly conceive how to…
any hint for that?
[[alternative HTML version deleted]]
More information about the R-help