This is becoming a little frustrating to watch, you are supposed to ask your questions providing a proper REPRoducible EXample (reprex) illustrating your issue.
Like in this answer
library(tidyverse)
sample_df <- data.frame(
ID = c(1, 1, 1, 1, 1, 2, 2),
dosis = c(10, 0, 10, 0, 10, 10, 0),
days = c(100, 70, 100, 35, 700, 50, 12)
)
sample_df %>%
group_by(ID) %>%
mutate(flag = if_else(dosis == 0 & days >= 30, TRUE, NA)) %>%
fill(flag, .direction = "down") %>%
filter(is.na(flag)) %>%
select(-flag)
#> # A tibble: 3 x 3
#> # Groups: ID [2]
#> ID dosis days
#> <dbl> <dbl> <dbl>
#> 1 1 10 100
#> 2 2 10 50
#> 3 2 0 12
Created on 2020-03-28 by the reprex package (v0.3.0.9001)