I have got a dataframe q. In a for-loop I am trying to print the value for mnt_for under the condition that diff is not 'no'.
I get this message: Error in if (!q$diff[j] == "no") { : missing value where TRUE/FALSE needed
How can I handle the missing value cases (in which I am most interested)
for(j in 1:nrow(q)) {
if (!q$diff[j]=='no'){
print(q[j,6])
}
}
res_id lud snow_mountain snow_mountain mnt mnt_for diff
67 3822 2018-02-12 160 160 160 160 no
68 3822 2018-02-13 NA NA 162 160 <NA>
69 3822 2018-02-14 NA NA 163 160 <NA>