make_pan_percdrainage_cols: Create percutaneous drainage columns for long conversion

View source: R/conv_pan.R

make_pan_percdrainage_colsR Documentation

Create percutaneous drainage columns for long conversion

Description

Create percutaneous drainage columns for long conversion

Usage

make_pan_percdrainage_cols(df)

Arguments

df

a data table to add the columns to

Details

First checks if the data table contains a "pan_percdrainage" column. If so, the column is split into 4 columns according to the regex pattern ",\s?".

Examples

x <- data.table::data.table(
pan_percdrainage = c("Yes-other", "Yes-bile", "Yes-pus", "Yes-amylase-rich fluid",
"Yes-amylase-rich fluid,Yes-pus", "Yes-bile,Yes-other", "Yes-amylase-rich fluid,Yes-pus,Yes-other",
"Yes-amylase-rich fluid,Yes-bile,Yes-other", "Yes-pus,Yes-bile", "Yes-pus,Yes-other",
"Yes-amylase-rich fluid,Yes-pus,Yes-bile", "Yes-amylase-rich fluid,Yes-other",
"Yes-amylase-rich fluid,Yes-pus,Yes-bile,Yes-other", "Yes-amylase-rich fluid,Yes-bile",
"Yes-pus,Yes-bile,Yes-other")
)

nsqipr:::make_pan_percdrainage_cols(x)
x


dylanrussellmd/nsqipr documentation built on Oct. 13, 2023, 11:01 a.m.