fixNA: Fix NA Table Row and Column Names

Description Usage Arguments Details Value Author(s) Examples

View source: R/fixna.R

Description

Fixes NA table row and column names by converting to a string, so that tables produced with the useNA option can be printed using xtable.

Usage

1
fixNA(tt, na.string = "NA")

Arguments

tt

a table

na.string

a string

Details

Only intended for printing tables using xtable, so only works for 1- and 2-dimensional tables.

Value

The table with NA row and column names replaced with na.string.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

1
2
3
4
5
6
7
## Not run: 
x <- factor(c("A", "B", "C", NA)[rbinom(100, 3, .5) + 1])
y <- factor(c("foo", "bar", NA)[rbinom(100, 2, .5) + 1])
xtable(fixNA(table(x, useNA = "always")))
xtable(fixNA(table(y, x, useNA = "always")))

## End(Not run)

tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.