bbcounttab: bbcounttab

Description Usage Arguments Details Author(s) Examples

View source: R/reportfunctions.R

Description

not done yet. But soon.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
bbcounttab(
  row = NULL,
  col = NULL,
  data,
  uniquecounts = NULL,
  caption = NULL,
  percs = TRUE,
  total = TRUE,
  dec = 1,
  split.tables = 300,
  margin = 3,
  table.continues = "Tabelle wird fortgesetzt",
  sortcounts = TRUE,
  split.cells = 30,
  ucol.name = "Patienten [n/(%)]"
)

Arguments

row

vector containing factors for row

col

vector containing factors for columns

data

the dataframe to get the values from

uniquecounts

only unique counts

caption

caption of table

percs

if TRUE percentage of row or column are displayed (default=TRUE)

total

sum of columns and rows (default= TRUE)

dec

decimal points (default =1)

split.tables

where to split wide tables to separate tables. The default value is 300 characters

margin

index, or vector of indices to generate margin for

table.continues

string (default: 'Tabelle wird fortgesetzt') passed to pandoc.table to be used as caption for long (split) without a use defined caption

sortcounts

if TRUE rows will be sorted descendent by counts

split.cells

where to split cells' text with line breaks. Default to 30, to disable set to Inf. Can be also supplied as a vector, for each cell separately (if length(split.cells) == number of columns + 1, then first value in split.cells if for row names, and others are for columns). Supports relative (percentage) parameters in combination with split.tables.

ucol.name

title of counted values default is "Patienten n/(%)"

Details

Creates a Crosstable in Markdown format with 2 dimensions and one variable for a unique counting

Author(s)

Stefan Bartels, email@biobits.eu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
PatientCohort<-c("CohortA","CohortA","CohortA","CohortB","CohortB","CohortB",
    "CohortB","CohortB","CohortB","CohortC","CohortC","CohortC","CohortC")
PatientClass<-c("ClassA","ClassB","ClassB","ClassC","ClassA","ClassC",
    "ClassA","ClassB","ClassA","ClassC","ClassA","ClassA","ClassA")
df<-as.data.frame(cbind(PatientCohort,PatientClass))
tab<-bbcounttab(row="PatientCohort",col="PatientClass",data=df,total=T,perc=T
                 ,dec=2,ucol.name="Classes")
tab

## End(Not run)

biobits/bbreportr documentation built on Dec. 26, 2021, 6:43 a.m.