Browse Source

Merge branch 'master' into rlang_formula

tags/0.2.0^2
Maxime Wack 2 years ago
parent
commit
ab9c71f01e
17 changed files with 179 additions and 161 deletions
  1. +2
    -0
      .Rbuildignore
  2. +4
    -0
      .gitignore
  3. +6
    -4
      DESCRIPTION
  4. +2
    -1
      NAMESPACE
  5. +5
    -0
      NEWS
  6. +2
    -0
      R/imports.R
  7. +2
    -2
      R/output.R
  8. +1
    -5
      README.Rmd
  9. +110
    -131
      README.md
  10. +9
    -8
      man/datatable.Rd
  11. +4
    -3
      man/insert.Rd
  12. +1
    -1
      man/pander.desctable.Rd
  13. +4
    -1
      man/reexports.Rd
  14. +17
    -0
      man/set_desctable_class.Rd
  15. +6
    -1
      man/statColumn.Rd
  16. +3
    -1
      man/statTable.Rd
  17. +1
    -3
      vignettes/desctable.Rmd

+ 2
- 0
.Rbuildignore View File

@@ -5,3 +5,5 @@
^LICENSE$
^\.travis\.yml$
^codecov\.yml$
^doc$
^Meta$

+ 4
- 0
.gitignore View File

@@ -1,2 +1,6 @@
inst/doc
README.html
/R/.Rhistory
/TAGS
doc
Meta

+ 6
- 4
DESCRIPTION View File

@@ -1,14 +1,16 @@
Package: desctable
Title: Produce Descriptive and Comparative Tables Easily
Version: 0.1.8
Version: 0.1.9
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")))
person("Adrien", "Boukobza", email = "hadrien_b@hotmail.fr", role = c("aut")),
person("Yihui", "Xie", email = "xieyihui@gmail.com", role = c("ctb")))
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,
and ready to be saved as csv, or piped to DT::datatable() or pander::pander() to integrate into reports.
Depends:
R (>= 3.2.3)
R (>= 3.2.3),
pander
License: GPL-3
Encoding: UTF-8
LazyData: true
@@ -25,5 +27,5 @@ Suggests:
rmarkdown,
purrr,
survival
RoxygenNote: 7.0.2
RoxygenNote: 7.1.1
VignetteBuilder: knitr

+ 2
- 1
NAMESPACE View File

@@ -5,6 +5,7 @@ S3method(datatable,default)
S3method(datatable,desctable)
S3method(desctable,default)
S3method(desctable,grouped_df)
S3method(pander,desctable)
S3method(print,desctable)
export("%>%")
export(ANOVA)
@@ -15,7 +16,6 @@ export(desctable)
export(fisher.test)
export(group_by)
export(is.normal)
export(pander.desctable)
export(percent)
export(statify)
export(stats_auto)
@@ -25,3 +25,4 @@ export(stats_normal)
export(tests_auto)
importFrom(dplyr,"%>%")
importFrom(dplyr,group_by)
importFrom(pander,pander)

+ 5
- 0
NEWS View File

@@ -1,3 +1,8 @@
Version 0.1.9

- Fix in default options for datatable output to follow DT update
- Fix pander export for R ≥ 4.0.0

Version 0.1.8

- Code cleanup:


+ 2
- 0
R/imports.R View File

@@ -7,3 +7,5 @@ dplyr::`%>%`
#' @export
dplyr::group_by

#' @importFrom pander pander
pander::pander

+ 2
- 2
R/output.R View File

@@ -79,7 +79,7 @@ pander.desctable <- function(x = NULL,
#' @note
#' You are recommended to escape the table content for security reasons (e.g. XSS attacks) when using this function in Shiny or any other dynamic web applications.
#' @references
#' See \url{http://rstudio.github.io/DT} for the full documentation.
#' See \url{https://rstudio.github.io/DT} for the full documentation.
#' @examples
#' library(DT)
#'
@@ -142,7 +142,7 @@ datatable.default <- function(data,
datatable.desctable <- function(data,
options = list(paging = F,
info = F,
search = F,
search = list(),
dom = "Brtip",
fixedColumns = T,
fixedHeader = T,


+ 1
- 5
README.Rmd View File

@@ -7,7 +7,7 @@ output: github_document
knitr::opts_chunk$set(message = F, warning = F)
```

[![Travis-CI Build Status](https://travis-ci.org/MaximeWack/desctable.svg?branch=master)](https://travis-ci.org/MaximeWack/desctable) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/desctable)](https://cran.r-project.org/package=desctable) [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/desctable)](http://www.r-pkg.org/pkg/desctable)
[![Travis-CI Build Status](https://travis-ci.org/MaximeWack/desctable.svg?branch=master)](https://travis-ci.org/MaximeWack/desctable) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/desctable)](https://cran.r-project.org/package=desctable) [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/desctable)](https://www.r-pkg.org:443/pkg/desctable)

# Introduction

@@ -45,11 +45,7 @@ devtools::install_github("maximewack/desctable")
# Loading

```{r}
# If you were to use DT, load it first
library(DT)

library(desctable)
library(pander) # pander can be loaded at any time
```

It is recommended to read this manual through its vignette:


+ 110
- 131
README.md View File

@@ -5,9 +5,10 @@ Desctable
Status](https://travis-ci.org/MaximeWack/desctable.svg?branch=master)](https://travis-ci.org/MaximeWack/desctable)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/desctable)](https://cran.r-project.org/package=desctable)
[![CRAN RStudio mirror
downloads](http://cranlogs.r-pkg.org/badges/desctable)](http://www.r-pkg.org/pkg/desctable)
downloads](http://cranlogs.r-pkg.org/badges/desctable)](https://www.r-pkg.org:443/pkg/desctable)

# Introduction
Introduction
============

Desctable is a comprehensive descriptive and comparative tables
generator for R.
@@ -24,16 +25,17 @@ the pipe (`%>%`)).
Enter **desctable**, a package built with the following objectives in
mind:

- generate descriptive and comparative statistics tables with nesting
- keep the syntax as simple as possible
- have good reasonable defaults
- be entirely customizable, using standard R tools and functions
- produce the simplest (as a data structure) output possible
- provide helpers for different outputs
- integrate with “modern” R usage, and the **tidyverse** set of tools
- apply functional paradigms
- generate descriptive and comparative statistics tables with nesting
- keep the syntax as simple as possible
- have good reasonable defaults
- be entirely customizable, using standard R tools and functions
- produce the simplest (as a data structure) output possible
- provide helpers for different outputs
- integrate with “modern” R usage, and the **tidyverse** set of tools
- apply functional paradigms

# Installation
Installation
============

Install from CRAN with

@@ -43,27 +45,22 @@ or install the development version from github with

devtools::install_github("maximewack/desctable")

# Loading
Loading
=======

``` r
# If you were to use DT, load it first
library(DT)

library(desctable)
library(pander) # pander can be loaded at any time
```
library(desctable)

It is recommended to read this manual through its vignette:

``` r
vignette("desctable")
```
vignette("desctable")

-----
------------------------------------------------------------------------

# Descriptive tables
Descriptive tables
==================

## Simple usage
Simple usage
------------

**desctable** uses and exports the pipe (`%>%`) operator (from packages
**magrittr** and **dplyr** fame), though it is not mandatory to use it.
@@ -73,10 +70,8 @@ function.

When used on a data.frame, it returns a descriptive table:

``` r
iris %>%
desctable()
```
iris %>%
desctable()

##   N % Mean sd Med IQR
## 1 Sepal.Length 150 NA NA NA 5.80 1.3
@@ -88,9 +83,7 @@ iris %>%
## 7 Species: versicolor 50 33.33333 NA NA NA NA
## 8 Species: virginica 50 33.33333 NA NA NA NA

``` r
desctable(mtcars)
```
desctable(mtcars)

##   N Mean sd Med IQR
## 1 mpg 32 20.090625 6.0269481 19.200 7.37500
@@ -113,7 +106,8 @@ functions depending on the type and distribution of the variables in the
data, and applies those statistical functions only on the relevant
variables.

## Output
Output
------

The object produced by `desctable` is in fact a list of data.frames,
with a “desctable” class.
@@ -121,11 +115,9 @@ Methods for reduction to a simple dataframe (`as.data.frame`,
automatically used for printing), conversion to markdown (`pander`), and
interactive html output with **DT** (`datatable`) are provided:

``` r
iris %>%
desctable() %>%
pander()
```
iris %>%
desctable() %>%
pander()

| | N | % | Mean | sd | Med | IQR |
| :----------- | :-- | :- | :--- | :--- | :-- | :-- |
@@ -152,8 +144,8 @@ header, export buttons, and rounding of values. Both `pander` and
`datatable` wrapper take a *digits* argument to set the number of
decimals to show. (`pander` uses the *digits*, *justify* and *missing*
arguments of `pandoc.table`, whereas `datatable` calls `prettyNum` with
the `digits` parameter, and removes `NA` values. You can set `digits =
NULL` if you want the full table and format it yourself)
the `digits` parameter, and removes `NA` values. You can set
`digits = NULL` if you want the full table and format it yourself)

Subsequent outputs in this README will use **pander**.

@@ -162,10 +154,10 @@ Subsequent outputs in this README will use **pander**.
`desctable` automatically chooses statistical functions if none is
provided, using the following algorithm:

- always show N
- if there are factors, show %
- if there are normally distributed variables, show Mean and SD
- if there are non-normally distributed variables, show Median and IQR
- always show N
- if there are factors, show %
- if there are normally distributed variables, show Mean and SD
- if there are non-normally distributed variables, show Median and IQR

For each variable in the table, compute the relevant statistical
functions in that list (non-applicable functions will safely return
@@ -202,19 +194,17 @@ package: `stats_auto`, `stats_default`, `stats_normal`,

You can also provide your own automatic function, which needs to

- accept a dataframe as its argument (whether to use this dataframe or
- accept a dataframe as its argument (whether to use this dataframe or
not in the function is your choice), and
- return a named list of statistical functions to use, as defined in
- return a named list of statistical functions to use, as defined in
the subsequent paragraphs.

<!-- end list -->
<!-- -->

``` r
# Strictly equivalent to iris %>% desctable() %>% pander()
iris %>%
desctable(stats = stats_auto) %>%
pander()
```
# Strictly equivalent to iris %>% desctable() %>% pander()
iris %>%
desctable(stats = stats_auto) %>%
pander()

| | N | % | Mean | sd | Med | IQR |
| :----------- | :-- | :- | :--- | :--- | :-- | :-- |
@@ -277,11 +267,9 @@ applied to factors, as is needed for the `percent` function.
As mentioned above, they need to be used inside a **named list**, such
as

``` r
mtcars %>%
desctable(stats = list("N" = length, "Mean" = mean, "SD" = sd)) %>%
pander()
```
mtcars %>%
desctable(stats = list("N" = length, "Mean" = mean, "SD" = sd)) %>%
pander()

| | N | Mean | SD |
| :--- | :- | :--- | :--- |
@@ -330,24 +318,22 @@ You don’t need to provide labels for all the variables, and extra labels
will be silently discarded. This allows you to define a “global” labels
vector and use it for multiple tables even after variable selections.

``` r
mtlabels <- c(mpg = "Miles/(US) gallon",
cyl = "Number of cylinders",
disp = "Displacement (cu.in.)",
hp = "Gross horsepower",
drat = "Rear axle ratio",
wt = "Weight (1000 lbs)",
qsec = "¼ mile time",
vs = "V/S",
am = "Transmission",
gear = "Number of forward gears",
carb = "Number of carburetors")

mtcars %>%
dplyr::mutate(am = factor(am, labels = c("Automatic", "Manual"))) %>%
desctable(labels = mtlabels) %>%
pander()
```
mtlabels <- c(mpg = "Miles/(US) gallon",
cyl = "Number of cylinders",
disp = "Displacement (cu.in.)",
hp = "Gross horsepower",
drat = "Rear axle ratio",
wt = "Weight (1000 lbs)",
qsec = "¼ mile time",
vs = "V/S",
am = "Transmission",
gear = "Number of forward gears",
carb = "Number of carburetors")

mtcars %>%
dplyr::mutate(am = factor(am, labels = c("Automatic", "Manual"))) %>%
desctable(labels = mtlabels) %>%
pander()

| | N | % | Mean | sd | Med | IQR |
| :---------------------- | :- | :- | :--- | :--- | :-- | :--- |
@@ -367,24 +353,24 @@ mtcars %>%

<br>

-----
------------------------------------------------------------------------

# Comparative tables
Comparative tables
==================

## Simple usage
Simple usage
------------

Creating a comparative table (between groups defined by a factor) using
`desctable` is as easy as creating a descriptive table.

It leverages the `group_by` function from **dplyr**:

``` r
iris %>%
group_by(Species) %>%
desctable() -> iris_by_Species
iris %>%
group_by(Species) %>%
desctable() -> iris_by_Species

iris_by_Species
```
iris_by_Species

##   Species: setosa (n=50) / N Species: setosa (n=50) / Mean
## 1 Sepal.Length 50 5.006
@@ -446,9 +432,7 @@ You can also see the grouping headers by inspecting the resulting
object, which is a nested list of dataframes, each dataframe being named
after the grouping factor and its levels (with sample size for each).

``` r
str(iris_by_Species)
```
str(iris_by_Species)

## List of 5
## $ Variables :'data.frame': 4 obs. of 1 variable:
@@ -480,13 +464,11 @@ str(iris_by_Species)

You can specify groups based on any variable, not only factors:

``` r
# With pander output
mtcars %>%
group_by(cyl) %>%
desctable() %>%
pander()
```
# With pander output
mtcars %>%
group_by(cyl) %>%
desctable() %>%
pander()

| | cyl: 4 (n=11)<br/>N | <br/>Med | <br/>IQR | cyl: 6 (n=7)<br/>N | <br/>Med | <br/>IQR | cyl: 8 (n=14)<br/>N | <br/>Med | <br/>IQR | tests<br/>p | <br/>test |
| :--- | :------------------ | :------- | :------- | :----------------- | :------- | :------- | :------------------ | :------- | :------- | :---------- | :----------- |
@@ -505,12 +487,10 @@ mtcars %>%

You can also specify groups based on an expression

``` r
iris %>%
group_by(Petal.Length > 5) %>%
desctable() %>%
pander()
```
iris %>%
group_by(Petal.Length > 5) %>%
desctable() %>%
pander()

| | Petal.Length \> 5: FALSE (n=108)<br/>N | <br/>% | <br/>Mean | <br/>sd | <br/>Med | <br/>IQR | Petal.Length \> 5: TRUE (n=42)<br/>N | <br/>% | <br/>Mean | <br/>sd | <br/>Med | <br/>IQR | tests<br/>p | <br/>test |
| :----------- | :------------------------------------- | :----- | :-------- | :------ | :------- | :------- | :----------------------------------- | :----- | :-------- | :------ | :------- | :------- | :---------------------------- | :---------- |
@@ -527,13 +507,11 @@ iris %>%

Multiple nested groups are also possible:

``` r
mtcars %>%
dplyr::mutate(am = factor(am, labels = c("Automatic", "Manual"))) %>%
group_by(vs, am, cyl) %>%
desctable() %>%
pander()
```
mtcars %>%
dplyr::mutate(am = factor(am, labels = c("Automatic", "Manual"))) %>%
group_by(vs, am, cyl) %>%
desctable() %>%
pander()

| | vs: 0 (n=18)<br/>am: Automatic (n=12)<br/>cyl: 8 (n=12)<br/>N | <br/><br/><br/>Med | <br/><br/><br/>IQR | <br/><br/>tests<br/>p | <br/><br/><br/>test | <br/>am: Manual (n=6)<br/>cyl: 4 (n=1)<br/>N | <br/><br/><br/>Med | <br/><br/><br/>IQR | <br/><br/>cyl: 6 (n=3)<br/>N | <br/><br/><br/>Med | <br/><br/><br/>IQR | <br/><br/>cyl: 8 (n=2)<br/>N | <br/><br/><br/>Med | <br/><br/><br/>IQR | <br/><br/>tests<br/>p | <br/><br/><br/>test | vs: 1 (n=14)<br/>am: Automatic (n=7)<br/>cyl: 4 (n=3)<br/>N | <br/><br/><br/>Med | <br/><br/><br/>IQR | <br/><br/>cyl: 6 (n=4)<br/>N | <br/><br/><br/>Med | <br/><br/><br/>IQR | <br/><br/>tests<br/>p | <br/><br/><br/>test | <br/>am: Manual (n=7)<br/>cyl: 4 (n=7)<br/>N | <br/><br/><br/>Med | <br/><br/><br/>IQR | <br/><br/>tests<br/>p | <br/><br/><br/>test |
| :--- | :------------------------------------------------------------ | :----------------- | :----------------- | :-------------------- | :------------------ | :------------------------------------------- | :----------------- | :----------------- | :--------------------------- | :----------------- | :----------------- | :--------------------------- | :----------------- | :----------------- | :-------------------- | :------------------ | :---------------------------------------------------------- | :----------------- | :----------------- | :--------------------------- | :----------------- | :----------------- | :-------------------- | :------------------ | :------------------------------------------- | :----------------- | :----------------- | :-------------------- | :------------------ |
@@ -555,30 +533,31 @@ level.
Statistical tests are automatically selected depending on the data and
the grouping factor.

## Advanced usage
Advanced usage
--------------

`desctable` automatically chooses statistical functions if none is
provided, using the following algorithm:

- if the variable is a factor, use `fisher.test`
- if the grouping factor has only one level, use the provided
- if the variable is a factor, use `fisher.test`
- if the grouping factor has only one level, use the provided
`no.test` (which does nothing)
- if the grouping factor has two levels
- and the variable presents homoskedasticity (p value for
`var.test` \> .1) and normality of distribution in both groups,
use `t.test(var.equal = T)`
- and the variable does not present homoskedasticity (p value for
`var.test` \< .1) but normality of distribution in both groups,
use `t.test(var.equal = F)`
- else use `wilcox.test`
- if the grouping factor has more than two levels
- and the variable presents homoskedasticity (p value for
`bartlett.test` \> .1) and normality of distribution in all
- if the grouping factor has two levels
- and the variable presents homoskedasticity (p value for
`var.test` &gt; .1) and normality of distribution in both
groups, use `t.test(var.equal = T)`
- and the variable does not present homoskedasticity (p value for
`var.test` &lt; .1) but normality of distribution in both
groups, use `t.test(var.equal = F)`
- else use `wilcox.test`
- if the grouping factor has more than two levels
- and the variable presents homoskedasticity (p value for
`bartlett.test` &gt; .1) and normality of distribution in all
groups, use `oneway.test(var.equal = T)`
- and the variable does not present homoskedasticity (p value for
`bartlett.test` \< .1) but normality of distribution in all
- and the variable does not present homoskedasticity (p value for
`bartlett.test` &lt; .1) but normality of distribution in all
groups, use `oneway.test(var.equal = F)`
- else use `kruskal.test`
- else use `kruskal.test`

You can specify the statistical test functions yourself with the *tests*
argument. This argument can either be:
@@ -599,8 +578,8 @@ the package.

You can also provide your own automatic function, which needs to

- accept a variable and a grouping factor as its arguments, and
- return a single-term formula containing a statistical test function.
- accept a variable and a grouping factor as its arguments, and
- return a single-term formula containing a statistical test function.

This function will be used on every variable and every grouping factor
to determine the appropriate test.
@@ -670,9 +649,9 @@ mechanism is a bit different from the *stats* argument.

The list must contain either `.auto` or `.default`.

- `.auto` needs to be an automatic function, such as `tests_auto`. It
- `.auto` needs to be an automatic function, such as `tests_auto`. It
will be used by default on all variables to select a test
- `.default` needs to be a single-term formula containing a
- `.default` needs to be a single-term formula containing a
statistical test function that will be used on all variables

You can also provide overrides to use specific tests for specific
@@ -733,10 +712,10 @@ in R can be used.

The conditions are that the function

- accepts a formula (`variable ~ grouping_variable`) as a first
- accepts a formula (`variable ~ grouping_variable`) as a first
positional argument (as is the case with most tests, like `t.test`),
and
- returns an object with a `p.value` element.
- returns an object with a `p.value` element.

Several convenience function are provided: formula versions for
`chisq.test` and `fisher.test` using generic S3 methods (thus the


+ 9
- 8
man/datatable.Rd View File

@@ -30,8 +30,8 @@ datatable(data, ...)

\method{datatable}{desctable}(
data,
options = list(paging = F, info = F, search = F, dom = "Brtip", fixedColumns = T,
fixedHeader = T, buttons = c("copy", "excel")),
options = list(paging = F, info = F, search = list(), dom = "Brtip", fixedColumns =
T, fixedHeader = T, buttons = c("copy", "excel")),
class = "display",
callback = DT::JS("return table;"),
caption = NULL,
@@ -57,14 +57,14 @@ datatable(data, ...)
\item{...}{arguments passed to \code{format}.}

\item{options}{a list of initialization options (see
\url{http://datatables.net/reference/option/}); the character options
\url{https://datatables.net/reference/option/}); the character options
wrapped in \code{\link[htmlwidgets]{JS}()} will be treated as literal
JavaScript code instead of normal character strings; you can also set
options globally via \code{\link{options}(DT.options = list(...))}, and
global options will be merged into this \code{options} argument if set}

\item{class}{the CSS class(es) of the table; see
\url{http://datatables.net/manual/styling/classes}}
\url{https://datatables.net/manual/styling/classes}}

\item{callback}{the body of a JavaScript callback function with the argument
\code{table} to be applied to the DataTables instance (i.e. \code{table})}
@@ -91,7 +91,7 @@ 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/});
\item{style}{the style name (\url{https://datatables.net/manual/styling/});
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
@@ -115,11 +115,12 @@ when the number of total records is less than the page size.}
\item{selection}{the row/column selection mode (single or multiple selection
or disable selection) when a table widget is rendered in a Shiny app;
alternatively, you can use a list of the form \code{list(mode = 'multiple',
selected = c(1, 3, 8), target = 'row')} to pre-select rows; the element
selected = c(1, 3, 8), target = 'row', selectable = c(-2, -3))} to
pre-select rows and control the selectable range; the element
\code{target} in the list can be \code{'column'} to enable column
selection, or \code{'row+column'} to make it possible to select both rows
and columns (click on the footer to select columns), or \code{'cell'} to
select cells}
select cells. See details section for more info.}

\item{extensions}{a character vector of the names of the DataTables
extensions (\url{https://datatables.net/extensions/index})}
@@ -180,5 +181,5 @@ datatable(data.frame(x = Sys.time()))
###
}
\references{
See \url{http://rstudio.github.io/DT} for the full documentation.
See \url{https://rstudio.github.io/DT} for the full documentation.
}

+ 4
- 3
man/insert.Rd View File

@@ -7,9 +7,9 @@
insert(x, y, position)
}
\arguments{
\item{x}{A vector}
\item{x}{A vector to be inserted into}

\item{y}{A vector or list of vectors}
\item{y}{A vector or list of vectors to insert into x}

\item{position}{The position / vector of positions to insert vector(s) y in vector x}
}
@@ -17,5 +17,6 @@ insert(x, y, position)
The combined vector
}
\description{
Insert a vector y inside another vector x at position
The vectors in the y list will be inserted
at positions respectively *after* the x[position] element of x
}

+ 1
- 1
man/pander.desctable.Rd View File

@@ -4,7 +4,7 @@
\alias{pander.desctable}
\title{Pander method for desctable}
\usage{
pander.desctable(
\method{pander}{desctable}(
x = NULL,
digits = 2,
justify = "left",


+ 4
- 1
man/reexports.Rd View File

@@ -5,6 +5,7 @@
\alias{reexports}
\alias{\%>\%}
\alias{group_by}
\alias{pander}
\title{Objects exported from other packages}
\keyword{internal}
\description{
@@ -12,6 +13,8 @@ These objects are imported from other packages. Follow the links
below to see their documentation.

\describe{
\item{dplyr}{\code{\link[dplyr]{\%>\%}}, \code{\link[dplyr]{group_by}}}
\item{dplyr}{\code{\link[dplyr:reexports]{\%>\%}}, \code{\link[dplyr]{group_by}}}

\item{pander}{\code{\link[pander]{pander}}}
}}


+ 17
- 0
man/set_desctable_class.Rd View File

@@ -0,0 +1,17 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{set_desctable_class}
\alias{set_desctable_class}
\title{Set the "desctable" class to the passed object}
\usage{
set_desctable_class(x)
}
\arguments{
\item{x}{Object to set the "desctable" class to}
}
\value{
The object with the class "desctable"
}
\description{
Set the "desctable" class to the passed object
}

+ 6
- 1
man/statColumn.Rd View File

@@ -15,5 +15,10 @@ statColumn(stat, data)
A vector for one statistic column
}
\description{
Generate one statistic for all variables
Use one stat function (made safe using statify) on all the data
to produce a single statistics column.
}
\details{
The result is either a numeric vector, or a character vector if
the content of the column is not made entirely of numbers.
}

+ 3
- 1
man/statTable.Rd View File

@@ -15,5 +15,7 @@ statTable(data, stats)
A dataframe of all statistics for all variables
}
\description{
Generate the table of all statistics for all variables
If stats is a list of functions, use them.
If it is a single function, use it with the entire data as
its argument to produce a list of statistical functions to use.
}

+ 1
- 3
vignettes/desctable.Rmd View File

@@ -2,14 +2,12 @@
title: "desctable usage vignette"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{desctable usage}
%\VignetteIndexEntry{desctable usage vignette}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, echo = F, message = F, warning = F}
library(pander)
library(DT)
library(desctable)

options(DT.options = list(#scrollX = T,


Loading…
Cancel
Save