tbl {clintools}R Documentation

Create a table (tbl)

Description

tbl() is a function which create a dataframe, which can be copied directly into word or presented in as a summary table.

Usage

tbl(df,strata,vars,render.numeric,
render.factor, tests, paired,
   digs_n,digs_f, digs_p, digs_s,
   only_stats, strata.fixed, strata.random,
   time.to, present.missing, markdown, caption)

Arguments

df

dataframe. (df)

strata

Column name of stratification (string)

vars

Column names of variables of interest (list)

render.numeric

list of presentation of numeric variables (list)

render.factor

presentation of factors, with simple removing one factor when only two exists

tests

list of tests carried out, currently the following works: t.test, wilcox.test, fisher.test, auc, lm, and glm. (list)

paired

if tests should be paired (boolean)

digs_n

digits for numeric (numeric)

digs_f

digits for factors (numeric)

digs_p

digits for p-values (numeric)

digs_s

digits for statistics (numeric)

only_stats

if only stats should be presented (booolean)

strata.fixed

list of columns which should be used as fixed stratification (list)

strata.random

list of columns which should be used as random stratification (list)

time.to

Column name of the time column for cox regression (list)

present.missing

default is dynamic where non-missing variables are not presented.

markdown

default is true and output is pander, while false output is a dataframe (boolean)

caption

Table caption only in use when markdown is true (string)

Value

Returns summarised information in dataframe.

Examples

## Not run: 
   hmm <- tbl(df,strata="group",
   vars = c("Gestational Age at birth","Maternal preeclampsia"),
   tests=c("wilcox.test","glm"),only_stats=F,strata.random = "site",
   markdown=F)
   pander::pander(hmm, keep.line.breaks = TRUE,split.tables=Inf, row.names = F)

## End(Not run)


[Package clintools version 0.9.10.1 Index]