Learn R Programming

CUFF (version 1.9)

printcross: Crosstabs print methods

Description

Functions to display (2 x 2) contingency table

Usage

# S3 method for cross
print(x, ..., test = "chisq.test", export = NULL)

Value

Print methods associated with the cross object.

Arguments

x

Object of type cross to print

...

Unused arguments

test

list of statistical tests (as character vector) passed to the 2x2 table. By default, test is set to "chisq.test" which performs a khi-square test with Yates continuity correction.

export

Either "pdf" or "xlsx" or NUll. Crosstab is flushed into either a pdf using latex or an Excel spreadsheet using package openxlsx

Author

Charles-Édouard Giguère

Details

Export to "pdf", "xlsx" open the crosstabs in the corresponding formats.

Examples

Run this code
require(CUFF)
### example of crosstabs
cr1 <- cross( ~ N + P, npk)
print(cr1, test = c("chisq.test", "fisher.test"))

Run the code above in your browser using DataLab