reshape_wide: Reshape dataset to wide format

View source: R/reshape_wide.R

reshape_wideR Documentation

Reshape dataset to wide format

Description

Reshape dataset to wide format

Usage

reshape_wide(
  df,
  case_id_var,
  time_id_var,
  timevar_max = 6,
  datsize = Inf,
  chunks = 10
)

Arguments

df

dataframe

case_id_var

String with name of ID variable indicating same patient. E.g. idvar="PUBCSNUM" for SEER data.

time_id_var

String with name of variable that indicates diagnosis per patient. E.g. timevar="SEQ_NUM" for SEER data.

timevar_max

Numeric; default 6. Maximum number of cases per id. All tumors > timevar_max will be deleted before reshaping.

datsize

Number of rows to be taken from df. This parameter is mainly for testing. Default is Inf so that df is fully processed.

chunks

Numeric; default 10. Technical parameter how the data is split during reshaping.

Value

df

Examples


data(us_second_cancer)

msSPChelpR::reshape_wide(us_second_cancer,
                         case_id_var = "fake_id", 
                         time_id_var = "SEQ_NUM", 
                         timevar_max = 2,
                         datsize = 10000)


marianschmidt/msSPChelpR documentation built on Feb. 1, 2024, 6:45 a.m.