Skip to contents

Creates a reproducibility-oriented table and APA-style prose statement reporting the R version and package versions used in an analysis.

Usage

mlm_software_table(packages = mlm_default_packages())

mlm_software_apa(packages = mlm_default_packages())

mlm_papaja_code(packages = mlm_default_packages(), bib_file = "r-references.bib")

Arguments

packages

Character vector of software or R package names to report. Use "R" to include the R version.

bib_file

Name of the BibTeX file to create or update when using the optional papaja workflow.

Details

mlm_papaja_code() returns R code that users can run when papaja is installed. The generated code uses papaja::r_refs() to create package references and papaja::cite_r() to create an APA-style R/package citation statement. papaja is optional and is not required to install or run mlmr.

Value

mlm_software_table() returns a data frame. mlm_software_apa() returns a manuscript-ready prose statement. mlm_papaja_code() returns character lines of reproducible R code.

Examples

mlm_software_table()
#>         Software Version                                               Purpose
#> R              R   4.6.0                     Statistical computing environment
#> mlmr        mlmr   0.1.0 Guided mixed-effects and multilevel modeling workflow
#> lme4        lme4   2.0.1                        Mixed-effects model estimation
#> shiny      shiny  1.13.0                 Interactive web application framework
#> bslib      bslib  0.10.0                                User interface theming
#> ggplot2  ggplot2   4.0.3                     Diagnostic and reporting graphics
#>                  Citation
#> R             R Core Team
#> mlmr               Harris
#> lme4         Bates et al.
#> shiny        Chang et al.
#> bslib   Sievert and Cheng
#> ggplot2           Wickham
mlm_software_apa()
#> [1] "Analyses were conducted in R version 4.6.0. Model estimation, reporting, and reproducible exports used mlmr version 0.1.0, lme4 version 2.0.1, shiny version 1.13.0, bslib version 0.10.0, ggplot2 version 4.0.3. Package versions are reported to support computational reproducibility."
cat(mlm_papaja_code(), sep = "\n")
#> # Optional papaja workflow for APA-style software citations.
#> # Install once if needed: install.packages("papaja")
#> reported_packages <- c("R", "mlmr", "lme4", "shiny", "bslib", "ggplot2")
#> 
#> if (requireNamespace("papaja", quietly = TRUE)) {
#>   papaja::r_refs(file = "r-references.bib")
#>   software_citation <- papaja::cite_r(
#>     file = "r-references.bib",
#>     pkgs = reported_packages,
#>     omit = FALSE
#>   )
#>   software_citation
#> } else {
#>   message("Install papaja to generate APA-style R/package citations and BibTeX references.")
#> }