diff --git a/NAMESPACE b/NAMESPACE index 5bb1dd5..9859f68 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -3,6 +3,8 @@ S3method(as.data.frame,desctable) S3method(datatable,default) S3method(datatable,desctable) +S3method(desctable,default) +S3method(desctable,grouped_df) S3method(print,desctable) S3method(statify,default) S3method(statify,formula) @@ -12,8 +14,6 @@ export(IQR) export(chisq.test) export(datatable) export(desctable) -export(desctable.default) -export(desctable.grouped_df) export(fisher.test) export(group_by) export(is.normal) diff --git a/R/build.R b/R/build.R index 50ce758..820c6c9 100644 --- a/R/build.R +++ b/R/build.R @@ -135,7 +135,7 @@ varColumn <- function(data, labels = NULL) #' group_by(Petal.Length > 5) %>% #' 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 if (any(data %>% lapply(is.logical) %>% unlist)) @@ -146,7 +146,7 @@ desctable <- function(data, ...) #' @rdname desctable #' @export -desctable.default <- function(data, stats = stats_auto, labels = NULL) +desctable.default <- function(data, stats = stats_auto, tests, labels = NULL) { # Build the complete table list(Variables = varColumn(data, labels), diff --git a/man/desctable.Rd b/man/desctable.Rd index a6b74bb..6822b65 100644 --- a/man/desctable.Rd +++ b/man/desctable.Rd @@ -6,11 +6,12 @@ \alias{desctable.grouped_df} \title{Generate a statistics table} \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{ \item{data}{The dataframe to analyze}