Build Common Tables of Summary Statistics for Reports

Mainly used to build tables that are commonly presented for bio-medical/health research, such as basic characteristic tables or descriptive statistics.


Travis-CI BuildStatus CRAN StatusBadge Coveragestatus AppVeyor buildstatus lifecycle Downloads

The main goal of carpenter to simplify making those pesky descriptive/basic characteristic tables often used in biomedical journal articles. It was designed to work well within the tidyverse ecosystem, e.g. relying on using pipes to chain functions together or having multiple, dedicated functions to use (rather than a monolithic one with lots of arguments).

Installation

This package is on CRAN, so install using:

install.packages('carpenter')

For the developmental version, install from GitHub:

# install.packages("remotes")
remotes::install_github('lwjohnst86/carpenter')

Example usage

Here is an example workflow for making tables:

library(carpenter)
outline_table(iris, 'Species') %>% 
    add_rows('Sepal.Length', stat_meanSD) %>%
    add_rows('Petal.Length', stat_meanSD) %>%
    add_rows('Sepal.Width', stat_medianIQR) %>% 
    build_table() 
Variables setosa versicolor virginica
Sepal.Length 5.0 (0.4) 5.9 (0.5) 6.6 (0.6)
Petal.Length 1.5 (0.2) 4.3 (0.5) 5.6 (0.6)
Sepal.Width 3.4 (3.2-3.7) 2.8 (2.5-3.0) 3.0 (2.8-3.2)

For a more detailed view of how to use carpenter, see ?carpenter or vignette('carpenter'). Or view the vignette directly here

Resources

There are several packages out there that help with making tables. Most of them work to output and customize the tables into a given format, for instance markdown or html, but assume the data is in the form you already want to present it in. So they don’t help with getting the data into the form of a table (in the context of descriptive/basic characteristic tables often seen in biomedical research). Even still, they are very useful to look over and learn about!

News

carpenter 0.2.2

Bug fixes

  • Fixed issue where factor ordering changes (#11; #13)
  • Fix errors due to update to dplyr (explicitly define dplyr::n()) and switch over to using _at dplyr versions.

General additions

  • Add code coverage and appveyor.

carpenter 0.2.1

Bug fixes

  • Fixed ERRORS in CRAN results due to changes and version update in dplyr
  • Fixed ERRORS in pander and table output due to changes in dplyr

Misc

  • Added tableone package to resources in vignette

carpenter 0.2.0

  • Major rewrite of the underlying code for carpenter, making it more rigorous and sturdy (compared to the previous version).
  • Added test suites to confirm the package does what it should.
  • Wrote a introduction vignette.
  • Added resources for other packages that make tables.
  • Added a NEWS.md file to track changes to the package.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("carpenter")

0.2.2 by Luke Johnston, 7 months ago


https://github.com/lwjohnst86/carpenter


Report a bug at https://github.com/lwjohnst86/carpenter/issues


Browse source code at https://github.com/cran/carpenter


Authors: Luke Johnston [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, magrittr, tidyr, pander, utils, stats, lazyeval, tibble

Suggests knitr, rmarkdown, testthat, covr


See at CRAN