cut_injd | R Documentation |
Given an injd
object, cut the range of the time period such that the
limits of the observed dates, first and last observed dates, are date0
and datef
, respectively. It is possible to specify just one date, i.e.
the two dates of the range do not necessarily have to be entered. See Note
section.
cut_injd(injd, date0, datef)
injd |
Prepared data, an |
date0 |
Starting date of class Date or
numeric. If |
datef |
Ending date. Same class as |
An injd
object with a shorter follow-up period.
Be aware that by modifying the follow-up period of the cohort, the study design is being altered. This function should not be used, unless there is no strong argument supporting it. And in that case, it should be used with caution.
# Prepare data
df_injuries <- prepare_inj(
df_injuries0 = raw_df_injuries,
player = "player_name",
date_injured = "from",
date_recovered = "until"
)
df_exposures <- prepare_exp(
df_exposures0 = raw_df_exposures,
player = "player_name",
date = "year",
time_expo = "minutes_played"
)
injd <- prepare_all(
data_exposures = df_exposures,
data_injuries = df_injuries,
exp_unit = "matches_minutes"
)
cut_injd(injd, date0 = 2018)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.