View source: R/first_turnover.R
first_turnover | R Documentation |
first_turnover() computes the last time an element is observed in a list
first_turnover(a)
a |
numeric vector such as year, or ordered number |
sequence function to identify a year an ordering index
a numeric vector
library(dplyr)
person_sequence <- stacked_data %>%
dplyr::select(year, id_j, id_i, id_ij) %>%
unique() %>%
group_by(id_ij) %>%
summarise(start = min(year), final = first_turnover(year)) %>%
mutate(time = final - start + 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.