R/get_dest_names.R

Defines functions get_dest_names

get_dest_names <- function(paths, events_df, state_names){
dest_names <- rep(NA, length(paths))

for (path_id in seq_along(paths)){

    event_ids <- paths[[path_id]]

    transitions <- events_df$transitions[events_df$event_id %in% event_ids]

    dest_names[path_id] <- transitions[transitions %in% state_names]
}
return(dest_names)
}

Try the twig package in your browser

Any scripts or data that you put into this service are public.

twig documentation built on April 12, 2025, 2:08 a.m.