buildTable1Rows: Build rows for table-1.

Description Usage Arguments Value Examples

Description

One row is produced for numeric variables, multiple rows for factors.

Usage

1
2
3
4
5
buildTable1Rows(theVariable, theData, groupBy = NULL, percentFirst = TRUE,
  conductGroupTests = TRUE, stringsAsFactors = FALSE,
  meanDigits = getOption("digits"), sdDigits = getOption("digits"),
  freqDigits = getOption("digits"), statDigits = getOption("digits"),
  pDigits = getOption("digits"))

Arguments

theVariable

A character vector specifying the name (column) to be processed

theData

The data.frame containing the data for the variable.

groupBy

A variable (factor) used to stratify the variable being reported (see details below).

percentFirst

A boolean, if TRUE numeric variables are printed as x%(n) otherwise as n(x%).

conductGroupTests

A boolean, if TRUE group comparisons are conducted (see details below).

stringsAsFactors

A boolean, if TRUE, any variable that is of type character will get coerced to a factor.

meanDigits

An integer indicating number of digits printed following the decimal place (this is not precision as in round, you get the number of digits you ask for, even if they are zero).

sdDigits

An integer indicating number of digits printed following the decimal place for standard deviations (this is not precision as in round, you get the number of digits you ask for, even if they are zero).

freqDigits

An integer indicating number of digits printed following the decimal place for percentages (this is not precision as in round, you get the number of digits you ask for, even if they are zero).

statDigits

An integer indicating number of digits printed following the decimal place for test statistics (this is not precision as in round, you get the number of digits you ask for, even if they are zero).

pDigits

An integer indicating number of digits printed following the decimal place for test P-Values (if numer of zeros in P is greater than pDigits the value will be "< 000...1").

Value

A data.frame.

Examples

1
2
3
4
library(dplyr)
library(tidyr)
buildTable1Rows(theVariable = "age", theData = table1Dat, groupBy="site", percentFirst = TRUE,
conductGroupTests = TRUE, meanDigits = 1, sdDigits = 1, freqDigits = 2, statDigits = 2, pDigits = 5)

svannoy/table1 documentation built on May 30, 2019, 8:45 p.m.