Extract, Format, and Print Statistical Output
Overview
Provides functions that format statistical output in a way that can be inserted into R Markdown documents. This is analogous to the apa_print() functions in the 'papaja' package but prints Markdown or LaTeX syntax.
- Fix changes in
wilcox.test()coming in devel versions of R. Changed test case toexact = TRUEbecause in the devel version, "exact = FALSEalways computes the asymptotic approximation of the conditional/permutation distribution, using the same test statistic in both cases".
From NEWS.md in the release
Install
Health
ERRORtestsr-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64
r-oldrel-macos-arm64
Running ‘testthat.R’ [3s/3s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(cocoon)
>
> test_check("cocoon")
Saving _problems/test-format_stats_htest-270.R
Saving _problems/test-format_stats_htest-274.R
Saving _problems/test-format_stats_htest-278.R
[ FAIL 3 | WARN 42 | SKIP 1 | PASS 303 ]
══ Skipped tests (1) ═══════════════════════════════════════════════════════════
• On CRAN (1): 'test-format_statvalues.R:94:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-format_stats_htest.R:267:3'): forma
...[truncated]...
:271:3'): formatting t-tests works properly ──
Expected `format_stats(test_ttest4)` to equal "_W_ = 40.5, _p_ = .510".
Differences:
`actual`: "_W_ = 40.5, _p_ = .495"
`expected`: "_W_ = 40.5, _p_ = .510"
Backtrace:
▆
1. ├─base::suppressMessages(...) at test-format_stats_htest.R:271:3
2. │ └─base::withCallingHandlers(...)
3. └─testthat::expect_equal(format_stats(test_ttest4), "_W_ = 40.5, _p_ = .510")
── Failure ('test-format_stats_htest.R:275:3'): formatting t-tests works properly ──
Expected `format_stats(test_ttest5)` to equal "_W_ = 40.5, _p_ = .330".
Differences:
`actual`: "_W_ = 40.5, _p_ = .323"
`expected`: "_W_ = 40.5, _p_ = .330"
Backtrace:
▆
1. ├─base::suppressMessages(...) at test-format_stats_htest.R:275:3
2. │ └─base::withCallingHandlers(...)
3. └─testthat::expect_equal(format_stats(test_ttest5), "_W_ = 40.5, _p_ = .330")
[ FAIL 3 | WARN 42 | SKIP 1 | PASS 303 ]
Error:
! Test failures.
Execution haltedr-oldrel-macos-x86_64
Running ‘testthat.R’ [8s/20s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(cocoon)
>
> test_check("cocoon")
Saving _problems/test-format_stats_htest-270.R
Saving _problems/test-format_stats_htest-274.R
Saving _problems/test-format_stats_htest-278.R
[ FAIL 3 | WARN 42 | SKIP 1 | PASS 303 ]
══ Skipped tests (1) ═══════════════════════════════════════════════════════════
• On CRAN (1): 'test-format_statvalues.R:94:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-format_stats_htest.R:267:3'): form
...[truncated]...
:271:3'): formatting t-tests works properly ──
Expected `format_stats(test_ttest4)` to equal "_W_ = 40.5, _p_ = .510".
Differences:
`actual`: "_W_ = 40.5, _p_ = .495"
`expected`: "_W_ = 40.5, _p_ = .510"
Backtrace:
▆
1. ├─base::suppressMessages(...) at test-format_stats_htest.R:271:3
2. │ └─base::withCallingHandlers(...)
3. └─testthat::expect_equal(format_stats(test_ttest4), "_W_ = 40.5, _p_ = .510")
── Failure ('test-format_stats_htest.R:275:3'): formatting t-tests works properly ──
Expected `format_stats(test_ttest5)` to equal "_W_ = 40.5, _p_ = .330".
Differences:
`actual`: "_W_ = 40.5, _p_ = .323"
`expected`: "_W_ = 40.5, _p_ = .330"
Backtrace:
▆
1. ├─base::suppressMessages(...) at test-format_stats_htest.R:275:3
2. │ └─base::withCallingHandlers(...)
3. └─testthat::expect_equal(format_stats(test_ttest5), "_W_ = 40.5, _p_ = .330")
[ FAIL 3 | WARN 42 | SKIP 1 | PASS 303 ]
Error:
! Test failures.
Execution haltedr-oldrel-windows-x86_64
Running 'testthat.R' [15s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(cocoon)
>
> test_check("cocoon")
Saving _problems/test-format_stats_htest-270.R
Saving _problems/test-format_stats_htest-274.R
Saving _problems/test-format_stats_htest-278.R
[ FAIL 3 | WARN 42 | SKIP 1 | PASS 303 ]
══ Skipped tests (1) ═══════════════════════════════════════════════════════════
• On CRAN (1): 'test-format_statvalues.R:94:3'
══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-format_stats_htest.R:267:3'): formatt
...[truncated]...
:271:3'): formatting t-tests works properly ──
Expected `format_stats(test_ttest4)` to equal "_W_ = 40.5, _p_ = .510".
Differences:
`actual`: "_W_ = 40.5, _p_ = .495"
`expected`: "_W_ = 40.5, _p_ = .510"
Backtrace:
▆
1. ├─base::suppressMessages(...) at test-format_stats_htest.R:271:3
2. │ └─base::withCallingHandlers(...)
3. └─testthat::expect_equal(format_stats(test_ttest4), "_W_ = 40.5, _p_ = .510")
── Failure ('test-format_stats_htest.R:275:3'): formatting t-tests works properly ──
Expected `format_stats(test_ttest5)` to equal "_W_ = 40.5, _p_ = .330".
Differences:
`actual`: "_W_ = 40.5, _p_ = .323"
`expected`: "_W_ = 40.5, _p_ = .330"
Backtrace:
▆
1. ├─base::suppressMessages(...) at test-format_stats_htest.R:275:3
2. │ └─base::withCallingHandlers(...)
3. └─testthat::expect_equal(format_stats(test_ttest5), "_W_ = 40.5, _p_ = .330")
[ FAIL 3 | WARN 42 | SKIP 1 | PASS 303 ]
Error:
! Test failures.
Execution halted- ERROR10 OK, 3 ERRORNow
- ERROR12 OK, 1 ERROR2026-06-04
- OK13 OK2026-05-30
- ERROR10 OK, 3 ERROR2026-05-25
- OK14 OK2026-03-10
Documentation
- Help pages
- 19 (1 internal)includes a package overview page
- Examples that run
- 94%17 run in a plain check · 1 hold no code
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
- cocoon HTML
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 2
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Releases over time
Issues over time
PRs over time
Commits over time
14 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/jeffreyrstevens/cocoon on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-24 · The repository has a site deploy workflow
pkgdown site last built 2026-09-24
Show all practicesHide 3 practices
Dependencies
Code & Tests
People & History
Package metadata
- First published
- 2024-11-05
- Total releases
- 5 / 2 yrs
- License
- GPL (>= 3) OSI
- Download size
- 4.1 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("cocoon")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.