R Package to Quickly and Neatly Summarize Data
library(knitr)
opts_chunk$set(echo = TRUE, results = 'asis', class.output = "small")
library(summarytools)
st_options(plain.ascii = FALSE,
style = "rmarkdown",
footnote = NA,
subtitle.emphasis = FALSE,
dfSummary.silent = TRUE,
dfSummary.style = "grid",
descr.silent = TRUE)
library(kableExtra)
Love summarytools? Share the love, buy me a coffee!
summarytools is a an R package for data
cleaning, exploring, and simple reporting. The package was developed with the
following objectives in mind:
On a more personal level, I simply wish to share with the R community and the
scientific community at large the functions I first developed for myself, but
realized would benefit others who are facing similar challenges when
dealing daily with (often messy) data.
The bulk of the technical documentation can now be found in the following
vignettes:
Introduction to summarytools | CRAN version
Summarytools in R Markdown | CRAN Version
PDF Manual (automatically generated by CRAN)
Additional software is used by summarytools for fine-tuning graphics as well
as offering interactive functionality. If you are installing summarytools
for the first time, click on the relevant link to get OS-specific instructions.
On Windows, no additional software is required.
Mac OS X
Ubuntu / Debian / Mint
Older Ubuntu (14 and 16)
Fedora / Red Hat / CentOS
Solaris
This method has the advantage of benefiting from minor fixes and improvements
that are added between CRAN releases. Its main drawback is that you won’t be
noticed when a new version is available. You can either check this page from
time to time, or best, use a package that checks for package updates on various
repositories, such as dtupdate and
Drat.
install.packages("remotes") # Using devtools or pak is also possible
library(remotes)
install_github("rapporter/pander") # Strongly recommended
install_github("dcomtois/summarytools", build_vignettes = TRUE)
CRAN versions are stable but are not updated as often as the GitHub versions. On
the plus side, they can be easier to install on some systems.
install.packages("summarytools")
Version 1.1.0 introduced a few significant improvements, aside from the bug
fixes.
stby()
, the useNA
parameter can be used to generate additionalNA
freq()
(always) and dfSummary()
(only when all values have labels;descr()
is more flexible with the stats parameters; you can for instancestats = c("all", -"kurtosis")
if you need everything except kurtosiszap_attr()
turns results into simple matrices,tb()
when you need to work further with thena.val
parameter was added to freq()
, ctable()
anddfSummary()
, which allows treating a particular character value orNA
. One common instance would be “” (empty string) fortb()
withfreq()
results. This is now a thing of the past.news(package="summarytools")
In dfSummary()
since 1.0.1:
help("st_options", "summarytools")
for examples)graph.magnif
should resolve itInf
values are handled properlyFor more details, see vignette("introduction", "summarytools")
as well as
news(package = "summarytools")
.
Magick++ can be installed using
Homebrew or
Macports.
Back to installation instructions
Magick++
sudo apt install libmagick++-dev
Back to installation instructions
This applies only if you are using Ubuntu Trusty (14.04) or Xenial (16.04).
sudo add-apt-repository -y ppa:opencpu/imagemagick
sudo apt-get update
sudo apt-get install -y libmagick++-dev
Back to installation instructions
Magick++
sudo yum install ImageMagick-c++-devel
Back to installation instructions
pkgadd -d http://get.opencsw.org/now
/opt/csw/bin/pkgutil -U
/opt/csw/bin/pkgutil -y -i imagemagick
/usr/sbin/pkgchk -L CSWimagemagick
Back to installation instructions
A big thanks to the following people who made donations:
If summarytools brings value to your work, please consider making a
donation. It will bring a smile to my face and boost my productivity! Buy me a coffee,
or use the PayPal link. Thanks!
The package comes with no guarantees. It is a work in progress and feedback is
always welcome. Please open an issue on
GitHub if you find a bug or
wish to submit a feature request.