I have a dataframe that looks like this and I try to generate the last column Searched
tibble::tribble( ~Group, ~Element, ~Searched,
"A", "aaa", NA,
"A", "bbb", NA,
"A", "ccc", NA,
"B", "aaa", TRUE,
"B", "bbb", TRUE,
"B", "ddd", FALSE,
"C", "aaa", TRUE,
"C", "bbb", TRUE,
"C", "ccc", FALSE )
I suppose I can find something with a combination of group_by
and lead/lag
but not sure how.