Suppose that I have this chunk of code below that gives me some numerical results. How can I change this so that it will remove negative results (i.e., remove anything that's below zero)? That is, I only want results that are 0 or above.
Final_df <- Initial_df %>%
mutate(Result= case_when(
`Type` == "A" ~ (Capability - Output)*(sum(Capability) - sum(Output)),
`Type` == "B" | `Type` == "C" ~ (Forecast - Output),
`Type` == "D" ~ Capability - Output))
Thank you,