Skip to contents

This is a special case of cg_window_by_episode(). It treats the visit column as an episode, with the argument episode_handling = "all".

Usage

cg_window_by_visit(cg, visit_col = NULL, preceding_days, following_days)

Arguments

cg

a chronogram

visit_col

a column with either dates of visits, or results. This is usually an experimental data column. Default is NULL. Provide unquoted.

preceding_days

used as filter( date > (date_col - preceding_days) )

following_days

used as filter( date < (date_col + following_days) )

Value

A subsetted chronogram

Examples


data("built_smallstudy")
cg <- built_smallstudy$chronogram

SevenDaysAfterEachStudyVisit <- cg_window_by_visit(
  cg,
  visit_col = serum_Ab_S, 7, 7
)