I have the following problem
df <- df %>% mutate(col1=ifelse(col2>1 ,0,3))
If I have col2 = null
, then the result is null. I tried
df <- df %>% mutate(col1=ifelse(col2>1 | is.na(col2)==FALSE ,0,3))
df <- df %>% mutate(col1=ifelse(col2>1 | is.null(col2)==FALSE ,0,3))
Yet, the outcome is the same. How to get 3 if col2 = null
?