sidenote, I don't understand the actual conceptual purpose of your code, but as written it throws warnings, and it doesn't make intuitive sense why one would do the thing that gives the warnings.
Therefore I suspect that
fes_eq[i] <- 1-f-exp(-r0*f[i])
should be changed to
fes_eq[i] <- 1-f[i]-exp(-r0*f[i])
so that each fes_eq[i] value equals exactly one thing, and not 1001 things...
but I don't know