@@ -3,6 +3,8 @@ | |||||
S3method(as.data.frame,desctable) | S3method(as.data.frame,desctable) | ||||
S3method(datatable,default) | S3method(datatable,default) | ||||
S3method(datatable,desctable) | S3method(datatable,desctable) | ||||
S3method(desctable,default) | |||||
S3method(desctable,grouped_df) | |||||
S3method(print,desctable) | S3method(print,desctable) | ||||
S3method(statify,default) | S3method(statify,default) | ||||
S3method(statify,formula) | S3method(statify,formula) | ||||
@@ -12,8 +14,6 @@ export(IQR) | |||||
export(chisq.test) | export(chisq.test) | ||||
export(datatable) | export(datatable) | ||||
export(desctable) | export(desctable) | ||||
export(desctable.default) | |||||
export(desctable.grouped_df) | |||||
export(fisher.test) | export(fisher.test) | ||||
export(group_by) | export(group_by) | ||||
export(is.normal) | export(is.normal) | ||||
@@ -135,7 +135,7 @@ varColumn <- function(data, labels = NULL) | |||||
#' group_by(Petal.Length > 5) %>% | #' group_by(Petal.Length > 5) %>% | ||||
#' desctable(tests = list(.auto = tests_auto, Species = ~chisq.test)) | #' desctable(tests = list(.auto = tests_auto, Species = ~chisq.test)) | ||||
#' } | #' } | ||||
desctable <- function(data, ...) | |||||
desctable <- function(data, stats, tests, labels) | |||||
{ | { | ||||
# Replace every logical vector with a factor and nice labels | # Replace every logical vector with a factor and nice labels | ||||
if (any(data %>% lapply(is.logical) %>% unlist)) | if (any(data %>% lapply(is.logical) %>% unlist)) | ||||
@@ -146,7 +146,7 @@ desctable <- function(data, ...) | |||||
#' @rdname desctable | #' @rdname desctable | ||||
#' @export | #' @export | ||||
desctable.default <- function(data, stats = stats_auto, labels = NULL) | |||||
desctable.default <- function(data, stats = stats_auto, tests, labels = NULL) | |||||
{ | { | ||||
# Build the complete table | # Build the complete table | ||||
list(Variables = varColumn(data, labels), | list(Variables = varColumn(data, labels), | ||||
@@ -6,11 +6,12 @@ | |||||
\alias{desctable.grouped_df} | \alias{desctable.grouped_df} | ||||
\title{Generate a statistics table} | \title{Generate a statistics table} | ||||
\usage{ | \usage{ | ||||
desctable(data, stats = stats_auto, tests = tests_auto, labels = NULL) | |||||
desctable(data, stats, tests, labels) | |||||
desctable.default(data, stats, tests, labels) | |||||
\method{desctable}{default}(data, stats = stats_auto, tests, labels = NULL) | |||||
desctable.grouped_df(data, stats, tests, labels) | |||||
\method{desctable}{grouped_df}(data, stats = stats_auto, tests = tests_auto, | |||||
labels = NULL) | |||||
} | } | ||||
\arguments{ | \arguments{ | ||||
\item{data}{The dataframe to analyze} | \item{data}{The dataframe to analyze} | ||||