Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions R/data_chisq.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#' Calculate chi square test for tabulate
#'
#' @param dwtable A dwtable object.
#' @param show_table Should the table be shown with the chi sqare
#' @param ... Other options
#'
#' @export
data_chisq <- function(dwtable, show_table = TRUE, ...) {
tablelist <- as.table(dwtable)
chisqlist <- lapply(tablelist, stats::chisq.test)
if (length(chisqlist) == 1) {
return(chisqlist[[1]])
}
chisqlist
}
Loading