cut_injd {injurytools}R Documentation

Cut the range of the follow-up

Description

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.

Usage

cut_injd(injd, date0, datef)

Arguments

injd

Prepared data, an injd object.

date0

Starting date of class Date or numeric. If numeric, it should refer to a year (e.g. date = 2018). Optional.

datef

Ending date. Same class as date0. Optional.

Value

An injd object with a shorter follow-up period.

Note

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.

Examples

# 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)


[Package injurytools version 1.0.3 Index]