R/get_A_idx.R

Defines functions get_A_idx

get_A_idx <- function(A0_idx, n_paths, E0_logical, E0_df, event_args, path_event_values, E_idx){

    A_idx <- A0_idx

    for (path_id in 1:n_paths){

        E_logical <- E0_logical
        for (event in event_args){
            E_logical <- E_logical & (E0_df[,event] == path_event_values[path_id, event])
        }

        A_idx[,path_id] <- E_idx[E_logical]

    }
    A_idx
}

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.