“From R to Manuscript”

report’s primary goal is to bridge the gap between R’s output and the formatted results contained in your manuscript. It automatically produces reports of models and dataframes according to best practice guidelines (e.g., APA’s style guide), ensuring standardization and quality in results reporting.

library(report)

# Example
model <- lm(Sepal.Length ~ Species, data=iris)
report(model)
## We fitted a linear model to predict Sepal.Length with Species. The model's explanatory power is substantial (R2 = 0.62, adj. R2 = 0.61). The model's intercept is at 5.01. Within this model:
## 
##   - The effect of Species (versicolor) is positive and can be considered as very large and significant (beta = 0.93, 95% CI [0.73, 1.13], p < .001, std. beta = 1.12).
##   - The effect of Species (virginica) is positive and can be considered as very large and significant (beta = 1.58, 95% CI [1.38, 1.79], p < .001, std. beta = 1.91).

Documentation

Documentation Blog Features

The package documentation can be found here. Check-out these tutorials:

Contribute

report is a young package in need of affection. You can easily be a part of the developing community of this open-source software and improve science by doing the following:

  • Create or check existing issues to report, replicate, understand or solve some bugs.
  • Create or check existing issues to suggest or discuss a new feature.
  • Check existing issues to see things that we’d like to implement, but where help is needed to do it.
  • Check existing issues to give your opinion and participate in package’s design discussions.

Don’t be shy, try to code and submit a pull request (See the contributing guide). Even if it’s not perfect, we will help you make it great!

Installation

Run the following:

install.packages("devtools")
devtools::install_github("easystats/report")
library("report")

Report all the things

General Workflow

The report package works in a two step fashion. First, you create a report object with the report() function (which takes different arguments depending on the type of object you are reporting). Then, this report object can be displayed either textually, using to_text(), or as a table, using to_table(). Moreover, you can access a more detailed (but less digested) version of the report using to_fulltext() and to_fulltable(). Finally, to_values() makes it easy to access all the internals of a model.

Supported Packages

Currently supported objects by report include cor.test, t.test correlation, glm, lme4::merMod, rstanarm::stanreg.

Examples

The report() function works on a variety of models, as well as dataframes:

## The data contains 150 observations of the following variables:
##   - Sepal.Length: Mean = 5.84, SD = 0.83, [4.30, 7.90].
##   - Sepal.Width: Mean = 3.06, SD = 0.44, [2.00, 4.40].
##   - Petal.Length: Mean = 3.76, SD = 1.77, [1.00, 6.90].
##   - Petal.Width: Mean = 1.20, SD = 0.76, [0.10, 2.50].
##   - Species: 3 levels: setosa (n = 50); versicolor (n = 50) and virginica (n = 50).

These reports nicely work within the tidyverse workflow:

# Correlation report
cor.test(iris$Sepal.Length, iris$Petal.Length) %>% 
  report()
## The Pearson's product-moment correlation between iris$Sepal.Length and iris$Petal.Length is positive, significant and large (r = 0.87, p < .001).

You can also create tables with the to_table() and to_fulltable() functions:

Finally, you can also find more details using to_fulltext():

## We fitted a Bayesian logistic mixed model (estimated using MCMC sampling with 4 chains of 2000
## iterations and a warmup of 1000) to predict vs with mpg (formula = vs ~ mpg). The model included
## cyl as random effects (formula = ~1 | cyl). Priors over parameters were set as normal (mean = 0.00,
## SD = 0.41) distributions. The Region of Practical Equivalence (ROPE) percentage was defined as the
## proportion of the posterior distribution within the [-0.18, 0.18] range. The 89% Credible Intervals
## (CIs) were based on Highest Density Intervals (HDI). Parameters were scaled by the mean and the SD
## of the response variable. Effect sizes were labelled following Cohen's (1988) recommendations.
## 
## The model's explanatory power is substantial (R2's median = 0.57, 89% CI [0.42, 0.69] Within this
## model, the explanatory power related to the fixed effects alone (marginal R2's median) is of 0.27
## (89% CI [0.00, 0.48]). The model's intercept, corresponding to vs = 0, mpg = 0 and cyl = 0, is at
## -5.16 (89% CI [-12.09, 2.10], 1.55% in ROPE, std. median = 0.00). Within this model:
## 
##   - The effect of mpg has a probability of 86.00% of being positive and can be considered as medium
## and not significant (median = 0.23, 89% CI [-0.11, 0.56], 38.10% in ROPE, std. median = 1.41). The
## algorithm successfuly converged (Rhat = 1.001) and the estimates can be considered as stable (ESS =
## 1276).

Credits

If you like it, you can put a star on this repo, and cite the package as follows:

  • Makowski & Lüdecke (2019). The report package for R: Ensuring the use of best practices for results reporting. CRAN. doi: .