From 897f05c871a0d94d417209e32bfb69ded19c8b5c Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Mon, 3 Feb 2020 16:03:15 +0100 Subject: [PATCH 1/2] Add author --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0be2184..782df8d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,8 @@ Package: desctable Title: Produce Descriptive and Comparative Tables Easily Version: 0.1.7 -Authors@R: person("Maxime", "Wack", email = "maximewack@free.fr", role = c("aut", "cre")) +Authors@R: c(person("Maxime", "Wack", email = "maximewack@free.fr", role = c("aut", "cre")), + person("Adrien", "Boukobza", email = "hadrien_b@hotmail.fr", role = c("aut"))) Description: Easily create descriptive and comparative tables. It makes use and integrates directly with the tidyverse family of packages, and pipes. Tables are produced as data frames/lists of data frames for easy manipulation after creation, From 7a54bc866068b4356456c5e378e3cb0423aecd62 Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Mon, 3 Feb 2020 16:16:07 +0100 Subject: [PATCH 2/2] Add parenthesis to desctable call in example + regen doc --- DESCRIPTION | 2 +- R/build.R | 2 +- man/chisq.test.Rd | 24 ++++++++++++---- man/datatable.Rd | 62 ++++++++++++++++++++++++++++++----------- man/desctable.Rd | 6 ++-- man/fisher.test.Rd | 31 +++++++++++++++++---- man/pander.desctable.Rd | 13 +++++++-- 7 files changed, 103 insertions(+), 37 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 782df8d..4292f6c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -24,5 +24,5 @@ Suggests: knitr, rmarkdown, survival -RoxygenNote: 6.1.1 +RoxygenNote: 7.0.2 VignetteBuilder: knitr diff --git a/R/build.R b/R/build.R index 24a0ddc..a482d9d 100644 --- a/R/build.R +++ b/R/build.R @@ -122,7 +122,7 @@ varColumn <- function(data, labels = NULL) #' @export #' @examples #' iris %>% -#' desctable +#' desctable() #' #' # Does the same as stats_auto here #' iris %>% diff --git a/man/chisq.test.Rd b/man/chisq.test.Rd index 3d8bbd4..0d340ee 100644 --- a/man/chisq.test.Rd +++ b/man/chisq.test.Rd @@ -11,13 +11,25 @@ The code for Monte Carlo simulation is a C translation of the Fortran algorithm \usage{ chisq.test(x, y, correct, p, rescale.p, simulate.p.value, B) -\method{chisq.test}{default}(x, y = NULL, correct = TRUE, - p = rep(1/length(x), length(x)), rescale.p = FALSE, - simulate.p.value = FALSE, B = 2000) +\method{chisq.test}{default}( + x, + y = NULL, + correct = TRUE, + p = rep(1/length(x), length(x)), + rescale.p = FALSE, + simulate.p.value = FALSE, + B = 2000 +) -\method{chisq.test}{formula}(x, y = NULL, correct = T, - p = rep(1/length(x), length(x)), rescale.p = F, - simulate.p.value = F, B = 2000) +\method{chisq.test}{formula}( + x, + y = NULL, + correct = T, + p = rep(1/length(x), length(x)), + rescale.p = F, + simulate.p.value = F, + B = 2000 +) } \arguments{ \item{x}{a numeric vector, or matrix, or formula of the form \code{lhs ~ rhs} where \code{lhs} and \code{rhs} are factors. \code{x} and \code{y} can also both be factors.} diff --git a/man/datatable.Rd b/man/datatable.Rd index ef5528c..4e8a0d4 100644 --- a/man/datatable.Rd +++ b/man/datatable.Rd @@ -8,26 +8,48 @@ \usage{ datatable(data, ...) -\method{datatable}{default}(data, options = list(), class = "display", - callback = DT::JS("return table;"), caption = NULL, - filter = c("none", "bottom", "top"), escape = TRUE, - style = "default", width = NULL, height = NULL, elementId = NULL, +\method{datatable}{default}( + data, + options = list(), + class = "display", + callback = DT::JS("return table;"), + caption = NULL, + filter = c("none", "bottom", "top"), + escape = TRUE, + style = "default", + width = NULL, + height = NULL, + elementId = NULL, fillContainer = getOption("DT.fillContainer", NULL), autoHideNavigation = getOption("DT.autoHideNavigation", NULL), - selection = c("multiple", "single", "none"), extensions = list(), - plugins = NULL, ...) - -\method{datatable}{desctable}(data, options = list(paging = F, info = F, - search = F, dom = "Brtip", fixedColumns = T, fixedHeader = T, buttons = - c("copy", "excel")), class = "display", - callback = DT::JS("return table;"), caption = NULL, - filter = c("none", "bottom", "top"), escape = FALSE, - style = "default", width = NULL, height = NULL, elementId = NULL, + selection = c("multiple", "single", "none"), + extensions = list(), + plugins = NULL, + ... +) + +\method{datatable}{desctable}( + data, + options = list(paging = F, info = F, search = F, dom = "Brtip", fixedColumns = T, + fixedHeader = T, buttons = c("copy", "excel")), + class = "display", + callback = DT::JS("return table;"), + caption = NULL, + filter = c("none", "bottom", "top"), + escape = FALSE, + style = "default", + width = NULL, + height = NULL, + elementId = NULL, fillContainer = getOption("DT.fillContainer", NULL), autoHideNavigation = getOption("DT.autoHideNavigation", NULL), selection = c("multiple", "single", "none"), extensions = c("FixedHeader", "FixedColumns", "Buttons"), - plugins = NULL, rownames = F, digits = 2, ...) + plugins = NULL, + rownames = F, + digits = 2, + ... +) } \arguments{ \item{data}{a data object (either a matrix or a data frame)} @@ -65,10 +87,15 @@ to escape the whole table, and \code{FALSE} means not to escape it; alternatively, you can specify numeric column indices or column names to indicate which columns to escape, e.g. \code{1:5} (the first 5 columns), \code{c(1, 3, 4)}, or \code{c(-1, -3)} (all columns except the first and -third), or \code{c('Species', 'Sepal.Length')}} +third), or \code{c('Species', 'Sepal.Length')}; since the row names take +the first column to display, you should add the numeric column indices +by one when using \code{rownames}} \item{style}{the style name (\url{http://datatables.net/manual/styling/}); -currently only \code{'default'} and \code{'bootstrap'} are supported} +currently only \code{'default'}, \code{'bootstrap'}, and +\code{'bootstrap4'} are supported. Note that DT doesn't contain the theme +files so in order to display the style correctly, you have to link +the necessary files in the header.} \item{width}{Width/Height in pixels (optional, defaults to automatic sizing)} @@ -99,7 +126,8 @@ extensions (\url{https://datatables.net/extensions/index})} \item{plugins}{a character vector of the names of DataTables plug-ins (\url{https://rstudio.github.io/DT/plugins.html}). Note that only those -plugins supported by the \code{DT} package can be used here.} +plugins supported by the \code{DT} package can be used here. You can see +the available plugins by calling \code{DT:::available_plugins()}} \item{rownames}{\code{TRUE} (show row names) or \code{FALSE} (hide row names) or a character vector of row names; by default, the row names are displayed diff --git a/man/desctable.Rd b/man/desctable.Rd index 07b11a3..2754fe6 100644 --- a/man/desctable.Rd +++ b/man/desctable.Rd @@ -8,11 +8,9 @@ \usage{ desctable(data, stats, tests, labels) -\method{desctable}{default}(data, stats = stats_auto, tests, - labels = NULL) +\method{desctable}{default}(data, stats = stats_auto, tests, labels = NULL) -\method{desctable}{grouped_df}(data, stats = stats_auto, - tests = tests_auto, labels = NULL) +\method{desctable}{grouped_df}(data, stats = stats_auto, tests = tests_auto, labels = NULL) } \arguments{ \item{data}{The dataframe to analyze} diff --git a/man/fisher.test.Rd b/man/fisher.test.Rd index 46ef11d..1afac18 100644 --- a/man/fisher.test.Rd +++ b/man/fisher.test.Rd @@ -6,14 +6,35 @@ \alias{fisher.test.formula} \title{Fisher's Exact Test for Count Data} \usage{ -fisher.test(x, y, workspace, hybrid, control, or, alternative, conf.int, - conf.level, simulate.p.value, B) +fisher.test( + x, + y, + workspace, + hybrid, + control, + or, + alternative, + conf.int, + conf.level, + simulate.p.value, + B +) \method{fisher.test}{default}(x, ...) -\method{fisher.test}{formula}(x, y = NULL, workspace = 200000, - hybrid = F, control = list(), or = 1, alternative = "two.sided", - conf.int = T, conf.level = 0.95, simulate.p.value = F, B = 2000) +\method{fisher.test}{formula}( + x, + y = NULL, + workspace = 200000, + hybrid = F, + control = list(), + or = 1, + alternative = "two.sided", + conf.int = T, + conf.level = 0.95, + simulate.p.value = F, + B = 2000 +) } \arguments{ \item{x}{either a two-dimensional contingency table in matrix form, a factor object, or a formula of the form \code{lhs ~ rhs} where \code{lhs} and \code{rhs} are factors.} diff --git a/man/pander.desctable.Rd b/man/pander.desctable.Rd index cbfe0a1..361a560 100644 --- a/man/pander.desctable.Rd +++ b/man/pander.desctable.Rd @@ -4,9 +4,16 @@ \alias{pander.desctable} \title{Pander method for desctable} \usage{ -pander.desctable(x = NULL, digits = 2, justify = "left", - missing = "", keep.line.breaks = T, split.tables = Inf, - emphasize.rownames = F, ...) +pander.desctable( + x = NULL, + digits = 2, + justify = "left", + missing = "", + keep.line.breaks = T, + split.tables = Inf, + emphasize.rownames = F, + ... +) } \arguments{ \item{x}{A desctable}