Learn R Programming

⚠️There's a newer version (0.6.0) of this package.Take me there.

report

“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)

model <- lm(Sepal.Length ~ Species, data = iris)
report(model)
## We fitted a linear model (estimated using OLS) to predict Sepal.Length with Species (formula =
## Sepal.Length ~ Species). Standardized parameters were obtained by fitting the model on a
## standardized version of the dataset. Effect sizes were labelled following Funder's (2019)
## recommendations.
## 
## The model explains a significant and substantial proportion of variance (R2 = 0.62, F(2, 147) =
## 119.26, p < .001, adj. R2 = 0.61). The model's intercept, corresponding to Sepal.Length = 0 and
## Species = setosa, is at 5.01 (SE = 0.07, 95% CI [4.86, 5.15], p < .001). Within this model:
## 
##   - The effect of (Intercept) is positive and can be considered as very large and significant (b =
## 5.01, SE = 0.07, 95% CI [4.86, 5.15], std. beta = -1.01, p < .001).
##   - The effect of Species [versicolor] is positive and can be considered as very large and
## significant (b = 0.93, SE = 0.10, 95% CI [0.73, 1.13], std. beta = 1.12, p < .001).
##   - The effect of Species [virginica] is positive and can be considered as very large and significant
## (b = 1.58, SE = 0.10, 95% CI [1.38, 1.79], std. beta = 1.91, p < .001).

Documentation

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 text_short(), or as a table, using table_short(). Moreover, you can access a more detailed (but less digested) version of the report using text_long() and table_short().

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

report(iris)
## The data contains 150 observations of the following variables:
## 
##   - Sepal.Length: Mean = 5.84, SD = 0.83, Median = 5.80, MAD = 1.04, range: [4.30, 7.90], Skewness = 0.31, Kurtosis = -0.57, 0 missing
##   - Sepal.Width: Mean = 3.06, SD = 0.44, Median = 3.00, MAD = 0.44, range: [2, 4.40], Skewness = 0.32, Kurtosis = 0.18, 0 missing
##   - Petal.Length: Mean = 3.76, SD = 1.77, Median = 4.35, MAD = 1.85, range: [1, 6.90], Skewness = -0.27, Kurtosis = -1.40, 0 missing
##   - Petal.Width: Mean = 1.20, SD = 0.76, Median = 1.30, MAD = 1.04, range: [0.10, 2.50], Skewness = -0.10, Kurtosis = -1.34, 0 missing
##   - Species: 3 levels: setosa (n = 50, 33.33%); versicolor (n = 50, 33.33%) and virginica (n = 50, 33.33%)

These reports nicely work within the tidyverse workflow:

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 very large (r = 0.87, 95% CI [0.83, 0.91], t(148) = 21.65, p < .001).

You can also create tables with the table_short() and table_long() functions:

lm(Sepal.Length ~ Petal.Length + Species, data = iris) %>% report() %>% 
    table_short()
## Parameter            | Coefficient |             CI |      p | Coefficient (std.) |  Fit
## ----------------------------------------------------------------------------------------
## (Intercept)          |        3.68 | [ 3.47,  3.89] | < .001 |               1.50 |     
## Petal.Length         |        0.90 | [ 0.78,  1.03] | < .001 |               1.93 |     
## Species [versicolor] |       -1.60 | [-1.98, -1.22] | < .001 |              -1.93 |     
## Species [virginica]  |       -2.12 | [-2.66, -1.58] | < .001 |              -2.56 |     
##                      |             |                |        |                    |     
## R2                   |             |                |        |                    | 0.84
## R2 (adj.)            |             |                |        |                    | 0.83

t-tests and correlations

t.test(mtcars$mpg ~ mtcars$am) %>% report()
## The Welch Two Sample t-test suggests that the difference of mtcars$mpg by mtcars$am (mean in group
## 0 = 17.15, mean in group 1 = 24.39) is significant (difference = -7.24, 95% CI [-11.28, -3.21],
## t(18.33) = -3.77, p < .01) and can be considered as very large (Cohen's d = -1.76).

Report participants details

This can be useful to complete the Participants paragraph of your manuscript.

data <- data.frame(Age = c(22, 23, 54, 21), Sex = c("F", "F", 
    "M", "M"))

paste(report_participants(data, spell_n = TRUE), "were recruited in the study by means of torture and coercion.")
## [1] "Four participants (Mean age = 30.0, SD = 16.0, range = [21, 54]; 50.0% females) were recruited in the study by means of torture and coercion."

Credits

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

  • Makowski, D., Ben-Shachar, M. S., & Lüdecke, D. (2020). The report package for R: Ensuring the use of best practices for results reporting. CRAN.

Copy Link

Version

Install

install.packages('report')

Monthly Downloads

8,286

Version

0.1.0

License

GPL-3

Maintainer

Dominique Makowski

Last Published

January 26th, 2025

Functions in report (0.1.0)

format_rope

Confidence/Credible Interval (CI) Formatting
model_values.lm

Linear Models Values
interpret_direction

Direction interpretation
model_values.lmerMod

Mixed Models Values
format_p

p-values Formatting
format_model

Model Name Formatting
.display

Pretty Printing
interpret_r

Correlation Coefficient Interpretation
format_text_collapse

Collapse Character Vector
format_algorithm

Model Algorithm Formatting
format_text_wrap

Autowrap String
print.report

Report printing
.display.data.frame

Dataframe Pretty Printing
print.report_table

Parameters table printing
interpret_r2

Coefficient of determination (R2) Interpretation
model_values.stanreg

Bayesian Models Values
interpret_rhat

Rhat Interpretation
interpret_rope

ROPE percentage Interpretation
%>%

re-export magrittr pipe operator
report.factor

Factor (Categorical Vector) Report
.colour_columns

Colour a column (Exported for test purposes)
report.htest

h-test (Correlation, t-test...) Report
to_values

Report values
.colour_detect

Detect coloured cells
.colour_column_if

Colour a column (Exported for test purposes)
as.report

interpret

Interpret Values
format_ci

Confidence/Credible Interval (CI) Formatting
format_value_unless_integers

Value Formatting
interpret_omega_squared

Omega Squared Interpretation
format_bf

Bayes Factor Formatting
format_value

Value Formatting
report.character

Data frame Report
is.rules

model_table_bayesian

Create Tables for Bayesian Linear Models
interpret_p

p-values Interpretation
interpret_bf

Bayes Factor (BF) Interpretation
rename_if_possible

Safe and convenient data frame utilities
reexports

Objects exported from other packages
model_table_glm

Create Tables for Linear Models
model_values

Model Values
report.easycorrelation

Correlation Report
report.estimateContrasts

Estimated Means, Contrasts, Slopes and Smooth Report
report.data.frame

Dataframe Report
report.numeric

Numeric Vector Report
report.stanreg

Bayesian Models Report
rules

Interpretation Grid
interpret_effective_sample

Effective Sample Size (ESS) Interpretation
show_packages

Cite Loaded Packages
interpret_odds

Odds ratio Interpretation
is.int

Check if integer
is.report

to_fulltable

Full report table display
to_table

Report table display
report

Automatic report of R objects
to_text

Report printing
to_fulltext

Report printing
report.lm

(General) Linear Models Report
report.lmerMod

Mixed Models Report
report.aov

ANOVAs Report
format_pd

Probability of direction (pd) Formatting
interpret_d

Standardized Difference (Cohen's d) Interpretation
.colour_remove

Remove ANSI color codes
report.estimate_contrasts

Estimated Means, Contrasts, Slopes and Smooth Report
format_text

Format text
text_initial

Initial model state textual reporting
text_performance

Performance textual reporting
text_model

Model description textual reporting
text_parameters

Parameters textual reporting
report.bayesfactor_inclusion

Inclusion Bayes factor Report
report.bayesfactor_models

Models' Bayes factor Report
interpret_gfi

Interpretation of SEM/CFA Indices of Fit
report.lavaan

SEM / CFA lavaan Models Report
report_participants

Reporting the participant data
text_long

Modify report output.
model_table

Table Summary
model_text

Text summary
report_sample

Sample Description
model_table.htest

h-test (Correlation, t-test...) Report
report_intercept

Model description
model_text.htest

h-test (Correlation, t-test...) Report
report.default

(General) Linear Models Report