tangram_to_df: tangram_to_df

View source: R/tangram_to_df.R

tangram_to_dfR Documentation

tangram_to_df

Description

This function converts a tangram object to dataframe. Will be in html format.

Usage

tangram_to_df(tbl, add_rown = FALSE, html = TRUE, hide_p = FALSE)

Arguments

tbl

a tangram object (table)

add_rown

logical. Whether to add a row id (id) to the output dataframe

html

logical. Whether to include html code for indentation.

hide_p

logical. Whether to hide p-values for variables with "nopv" in the label (first column). This will remove the "nopv" text as well.

Examples

library(tangram)
tab <- tangram(drug~bili+albumin+stage::Categorical+protime+sex+age+spiders,
              data = pbc,
              style = "lancet",
              id = "mytbl3")
tangram_to_df(tbl = tab, html = F)

## hide_p example
tab2 <- tangram(drug~bili+albumin+stage::Categorical+protime+sex+age+spiders,
              data = pbc %>% 
              labelled::set_variable_labels(albumin = "nopv Albumin (gm/dl)"),
              style = "lancet",
              test = T,
              id = "mytbl3")
tangram_to_df(tbl = tab, html = F)

olsonma/mollr documentation built on Aug. 2, 2022, 9:17 p.m.