我有以下提示:
results_summary_tbl <- tribble(
~event_id, ~most_wins_in_a_row, ~number_of_winners, ~winners, ~years,
"A", 3, 1, "4322", "4322 = (2011, 2013, 2014)",
"C", 2, 2, "5556 , 2391", "5556 = (2011, 2013), 2391 = (2015, 2016)",
"B", 2, 1, "7893", "7893 = (2013, 2014)",
"D", 1, 5, "4219 , 7623 , 8003 , 2851 , 0418", "4219 = (2011), 7623 = (2013), 8003 = (2014), 2851 = (2016), 0418 = (2017)"
)
对于每个事件,我想使用lag()和/或lead()函数找到最长的条纹。预期的输出应如下所示:
{{1}}
谢谢