Have you taken a look into the guide I gave you? that is not copy/paste friendly and makes things harder for people trying to help. I'm going to make an extra effort this time but don't expect people to do this very often, the polite thing to do here is to provide a proper reprex for your question.
library(tidyverse)
sample_df <- data.frame(
stringsAsFactors = FALSE,
t = c(1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5),
value = c(3, 4, 5, 6, 6, 5, 6, 7, 8, 9, 6, 7, 8, 5, 4),
Stock = c("x","x","x","x","x","y",
"y","y","y","y","z","z","z","z","z")
)
sample_df %>%
group_by(Stock) %>%
mutate(flag = if_else(value >= 7, TRUE, NA)) %>%
fill(flag, .direction = "down") %>%
filter(flag) %>%
select(-flag)
#> # A tibble: 7 x 3
#> # Groups: Stock [2]
#> t value Stock
#> <dbl> <dbl> <chr>
#> 1 3 7 y
#> 2 4 8 y
#> 3 5 9 y
#> 4 2 7 z
#> 5 3 8 z
#> 6 4 5 z
#> 7 5 4 z
Created on 2020-03-15 by the reprex package (v0.3.0.9001)