With a vector dr, I need to check if there are more than 5 values in dr > 0. If so keep it as as. If not return the vector with replacing all values with 0.
dr <- c(1,5,3,2,0,2,0,2,0,0,0,2,0)
will be
dr <- c(1,5,3,2,0,2,0,2,0,0,0,2,0)
but
dr <- c(1,0,0,0,0,2,0,0,0,0,0,2,0)
will be
dr <- c(0,0,0,0,0,0,0,0,0,0,0,0,0)