ORtable: Function to compile OR-table.

Description Usage Arguments Value Examples

View source: R/ORtable.R

Description

Function to compile OR-table.

Usage

1
2
3
4
ORtable(data, this.outcome, info, sign.digits = 2, sign.digits.OR = 3,
  pvalue.digits = 3, pvalue.cutoff = 0.001, test.input = FALSE,
  factor.level.bullet = "- ", less.than.character = "< ",
  linebreak.tag = "")

Arguments

data

A data frame that contains the data (one row per participant).

this.outcome

The name of the variable (column) in data that is the binary outcome for the logistic regression models.

info

A data frame with specifications for the BL-table. (See Examples below.)

sign.digits

Digits used for parameter estimate

sign.digits.OR

Digits used for odds ratio with conf.intervals

pvalue.digits

Digits used for p-values.

pvalue.cutoff

Cutoff for changing p-values to simply 'smaller than', e.g., p < 0.001.

test.input

Whether the input is tested for logical consistency. Warning: testing is not comprehensive. Setting test.input = FALSE will bypass logical tests.

factor.level.bullet

The character to be prepended to factor levels (listing). The default is factor.level.bullet = "- " (hyphen/minus) but it can be reset to any character string. If the result is passed on to html-rendering an en-dash can be produced by factor.level.bullet = "&#8211; " (HTML-code for the en-dash). Other useful options for (subsequent) HTML-rendering: factor.level.bullet = "&nbsp; &nbsp; " forces non-breaking space and effectively leads to indentation of factor levels; factor.level.bullet = "&#187; " prints right double angle quotes in HTML.

less.than.character

The character to be prepended to the cutoff-value for the p-values (e.g., '< 0.001'). The default is less.than.character = "< " but it can be reset to any character string. If the result is passed on to html-rendering this symbol can be produced by less.than.character = "&lt; " (HTML-friendly name for 'less than' since '<' is used in HTML-tags and might not render correctly as a character; e.g., when using function htmlTable() in the htmlTable-package).

linebreak.tag

Can be used to insert a linebreak-command in the table headers to bring the counts to a new line. The default is linebreak.tag = "" effectively not inserting any such command. For subsequent HTML-rendering linebreak.tag = "<br>" (HTML tag to insert a single line break) is useful.

Value

An R character-matrix containing the compiled table information.

Examples

1
2
3
4
5
## Not run: 
ORtable(data = example_data, info = example_variables,
  this.outcome = "Return_within_90_days", test.input = TRUE)

## End(Not run)

FrThomas/risyphus documentation built on Dec. 6, 2019, 6:27 a.m.