Skip to contents

How long new links last. A link is followed from the version in which it appears between two features that both existed before; the share still present is measured 1, 2, ... horizon versions later.

Usage

vp_link_lifetime(
  history,
  graph = c("excludes", "requires", "atleastone"),
  horizon = 5
)

Arguments

history

A history: the versions of a model, from vp_read_history() or vp_history(), oldest first.

graph

Which graph: "requires", "excludes" or "atleastone" (the last one needs or_graph = TRUE in vp_generate()).

horizon

How many versions to follow each link.

Value

A tibble with age (versions after it appeared), followed (links that can be followed that far), still_present and share.

Examples

gens <- c("miband1", "miband2", "miband3", "miband4", "miband6")
history <- vp_history(
  vp_example(paste0(gens, "_realized.uvl")),
  versions = gens,
  or_graph = TRUE
)
vp_link_lifetime(history, "requires", horizon = 2)
#> # A tibble: 2 × 4
#>     age followed still_present share
#>   <int>    <dbl>         <dbl> <dbl>
#> 1     1       22            13 0.591
#> 2     2       11            11 1