I want to extract the rows with at least one value in the columns c1-c10. I have data like this (for my data there are in total 11 columns counting the date and Q. Date and Q have values in all rows).
date c1 c2 c3 c4 ... Q
1 0.1 NA NA NA 300
2 NA 0.2 1.3 NA 100
3 NA NA NA NA 200
4 NA 0.3 NA 0.4 100
5 NA 1.4 NA NA 150
6 NA NA NA NA 200
7 0.5 0.3 0.5 0.6 100
I want to get this
date c1 c2 c3 c4 ... Q
1 0.1 NA NA NA 300
2 NA 0.2 1.3 NA 100
4 NA 0.3 NA 0.4 100
5 NA 1.4 NA NA 150
7 0.5 0.3 0.5 0.6 100
I tried this
datawide2<- datawide1 %>% filter(rowSums(.[2:10]!="NULL")>=1)
But the result is just the rows that has all values in all columns c1-10. So in this case just shows me
date c1 c2 c3 c4 ... Q
7 0.5 0.3 0.5 0.6 100
Can you help me? I don't know what is missing in what I did.
I searched in other questions but didn't find the answer.