I have merged health data (cases) with population data. In some instances, the number of cases (n) is greater than the population size (N). I will need to drop these rows.
What is the most efficient way to do this in R? For example: where n > N, replace n with 0?
df = df[df$n < df$N,]
df[df$n > df$N,"n"] = 0