make_hep_con_ablation_long | R Documentation |
Convert hep_con_ablation_140101 column from wide to long format
make_hep_con_ablation_long(df)
df |
a data.table |
The data contained in the 5 "hep_con_ablation" columns created by make_hep_con_ablation_cols
are converted into a long format.
If "hep_con_ablation_140101" is a column in df
, it will be broken into a long format with
caseid
as the ID variable for joining back to the main table. This is because the targeted hepatectomy
datasets input multiple values into a single "hep_con_ablation_140101" column. For example,
"Microwave ablation,Other ablation" may be an entry in the raw data set. This makes
parsing for patients that had other types of concurrent ablation at any point, for example, very difficult.
Note that this does not alter the "hep_con_ablation_140101" column.
a data.table
x <- data.table::data.table(caseid = 1:12,
hep_con_ablation_140101 = c("Microwave ablation", "RFA ablation", "Other ablation",
"Microwave ablation,Other ablation", "RFA ablation,Microwave ablation",
"RFA ablation,Other ablation", "RFA ablation,Alcohol ablation", "Alcohol ablation",
"Microwave ablation,Alcohol ablation", "Cryoablation", NA, "RFA ablation,Cryoablation"))
nsqipr:::make_hep_con_ablation_cols(x)
nsqipr:::make_hep_con_ablation_long(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.