Hello, when working in Rstudio I have run into an error/warning message that I cannot seem to figure out. I am trying to use ifelse with multiple conditions from various columns in my dataframe. They are all the same length, just one contains more NA values.
Here is my code:
april2021$detection <- ifelse ((april2021$x <= april2021$y &
april2021$z > 3.5 &
april2021$z[findInterval(april2021$z, c(4,5.3)) == FALSE]), 1, 0)
Here is my error:
Warning in april2021$x <= april2021$y & :
longer object length is not a multiple of shorter object length
Please Advise