tests/testthat/_snaps/tm_t_pp_medical_history.md

template_medical_history - non-default parameters

Code
  res
Output
  {
      labels <- teal.data::col_labels(anl, fill = FALSE)[c("mhbodsys", 
          "mhterm", "mhdistat")]
      mhbodsys_label <- labels["mhbodsys"]
      result_raw <- anl %>% dplyr::select(mhbodsys, mhterm, mhdistat) %>% 
          dplyr::arrange(mhbodsys) %>% dplyr::mutate_if(is.character, 
          as.factor) %>% dplyr::mutate_if(is.factor, function(x) explicit_na(x, 
          "UNKNOWN")) %>% dplyr::distinct() %>% `colnames<-`(labels)
      table <- rtables::basic_table() %>% rtables::split_cols_by_multivar(colnames(result_raw)[2:3]) %>% 
          rtables::split_rows_by(colnames(result_raw)[1], split_fun = rtables::drop_split_levels) %>% 
          rtables::split_rows_by(colnames(result_raw)[2], split_fun = rtables::drop_split_levels, 
              child_labels = "hidden") %>% rtables::analyze_colvars(function(x) x[seq_along(x)]) %>% 
          rtables::build_table(result_raw)
      main_title(table) <- paste("Patient ID:", NULL)
  }


Try the teal.modules.clinical package in your browser

Any scripts or data that you put into this service are public.

teal.modules.clinical documentation built on April 4, 2025, 12:35 a.m.