txt_chisquare_report: Summary text functions for html tables

View source: R/txt_chisquare_report.R

txt_chisquare_reportR Documentation

Summary text functions for html tables

Description

This function returns html formatted text summary of a Chi-sqauare test. The input object must be a chisq.test object, and the p-value is formatted by the 'htmlTable::txtPval()' function.

Usage

txt_chisquare_report(chisquare_object)

Arguments

chisquare_object

A Chi-square object

See Also

txtPval, sprintf, chisq.test

Examples

library(htmlTable)
# a basic 2x2 table
table(mtcars$vs,mtcars$cyl) # the table
cstest1 <-chisq.test(table(mtcars$vs,mtcars$am)) # the chi.square test object
htmlTable::htmlTable(txt_chisquare_report(cstest1))

# a 2x3 table
table(mtcars$vs,mtcars$cyl)
cstest2 <-chisq.test(table(mtcars$vs,mtcars$cyl))
htmlTable::htmlTable(txt_chisquare_report(cstest2))

JMLuther/tabletools documentation built on July 1, 2024, 2:01 p.m.