Add days to cohort start
+ +padCohortStart.Rd
padCohortStart()
Adds (or subtracts) a certain number of days to the cohort
+start date. Note:
If the days added means that cohort start would be after cohort end then +the cohort entry will be dropped.
+If subtracting day means that cohort start would be before observation +period start then the cohort entry will be dropped.
+
Usage
+padCohortStart(cohort, days, cohortId = NULL, name = tableName(cohort))
Examples
+# \donttest{
+library(CohortConstructor)
+cdm <- mockCohortConstructor()
+# add 10 days to each cohort entry
+cdm$cohort1 |>
+ padCohortStart(days = 10)
+#> # Source: table<main.cohort1> [9 x 4]
+#> # Database: DuckDB v1.0.0 [unknown@Linux 6.5.0-1025-azure:R 4.4.1/:memory:]
+#> cohort_definition_id subject_id cohort_start_date cohort_end_date
+#> <int> <int> <date> <date>
+#> 1 1 1 2001-06-09 2003-05-01
+#> 2 1 1 2003-05-12 2006-06-10
+#> 3 1 2 2000-05-14 2000-05-17
+#> 4 1 2 2000-05-28 2001-01-23
+#> 5 1 3 2015-02-06 2015-06-28
+#> 6 1 4 1996-07-10 1998-11-20
+#> 7 1 5 2012-03-30 2012-04-30
+#> 8 1 5 2012-05-11 2012-07-24
+#> 9 1 7 2014-03-18 2014-03-20
+# }
+