@@ -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, | |||
@@ -23,5 +24,5 @@ Suggests: | |||
rmarkdown, | |||
purrr, | |||
survival | |||
RoxygenNote: 6.1.1 | |||
RoxygenNote: 7.0.2 | |||
VignetteBuilder: knitr |
@@ -137,7 +137,7 @@ varColumn <- function(data, labels = NULL) { | |||
#' @export | |||
#' @examples | |||
#' iris %>% | |||
#' desctable | |||
#' desctable() | |||
#' | |||
#' # Does the same as stats_auto here | |||
#' iris %>% | |||
@@ -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.} | |||
@@ -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 | |||
@@ -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} | |||
@@ -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.} | |||
@@ -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} | |||