make_hep_neotherapy_long | R Documentation |
Convert hep_neotherapy_140101 column from wide to long format
make_hep_neotherapy_long(df)
df |
a data.table |
The data contained in the 5 "hep_neotherapy" columns created by make_hep_neotherapy_cols
are converted into a long format.
If "hep_neotherapy_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_neotherapy_140101" column. For example,
"Locoregional interarterial infusion,Other type" may be an entry in the raw data set. This makes
parsing for patients that had other types of neoadjuvant therapy at any point, for example, very difficult.
Note that this does not alter the "hep_neotherapy_140101" column.
a data.table
x <- data.table::data.table(caseid = 1:22,
hep_neotherapy_140101 = c("Preoperative systemic chemotherapy", "Portal vein embolization",
"Locoregional liver ablation", "Preoperative systemic chemotherapy,Portal vein embolization",
"Locoregional interarterial infusion,Portal vein embolization",
"Locoregional liver ablation,Portal vein embolization", "Other type",
"Preoperative systemic chemotherapy,Locoregional liver ablation",
"Preoperative systemic chemotherapy,Other type", "Locoregional interarterial infusion",
"Portal vein embolization,Other type", "Locoregional interarterial infusion,Other type",
"Preoperative systemic chemotherapy,Locoregional interarterial infusion",
"Preoperative systemic chemotherapy,Portal vein embolization,Other type",
"Preoperative systemic chemotherapy,Locoregional liver ablation,Other type",
"Preoperative systemic chemotherapy,Locoregional liver ablation,Portal vein embolization",
"Locoregional liver ablation,Other type",
"Locoregional interarterial infusion,Locoregional liver ablation,Portal vein embolization",
"Preoperative systemic chemotherapy,Locoregional interarterial infusion,Portal vein embolization",
"Locoregional interarterial infusion,Locoregional liver ablation",
"Preoperative systemic chemotherapy,Locoregional interarterial infusion,Locoregional liver ablation",
"Locoregional interarterial infusion,Locoregional liver ablation,Portal vein embolization,Other type"))
nsqipr:::make_hep_neotherapy_cols(x)
nsqipr:::make_hep_neotherapy_long(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.