# merge data as the example modification
require(magrittr)
# example with one modification type (removal)
# return table
mod_track(example_data, strings_to_NA(example_data), patient_id)
# return plot
mod_track(example_data, strings_to_NA(example_data), patient_id, plot = TRUE)
# example with multiple modification types (removal, substitution and addition)
example_data %>%
strings_to_NA() %>%
merge_cols(diabetes_type, diabetes) ->
modded_data
# return table
mod_track(example_data, modded_data, patient_id, vars2compare = c("t_stage",
"diabetes_type_diabetes_merged" = "diabetes", "diabetes_type_diabetes_merged"
= "diabetes_type"), plot = FALSE)
# return plot
mod_track(example_data, modded_data, patient_id, vars2compare = c("t_stage",
"diabetes_type_diabetes_merged" = "diabetes", "diabetes_type_diabetes_merged"
= "diabetes_type"), plot = TRUE)
Run the code above in your browser using DataLab