Skip to content

cocoon

0.3.1Package record

Extract, Format, and Print Statistical Output

0packages depend
4.4Kdownloads / year
99.9%test coverage
10/13flavors OK

Overview

About

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.

Changes in 0.3.1
  • Fix changes in wilcox.test() coming in devel versions of R. Changed test case to exact = TRUE because in the devel version, "exact = FALSE always 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

CRAN checks
3ERROR10OK
Check messages
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 halted

r-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 halted

r-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

CRAN check page ↗

Slowest check: 2.3 min · r-oldrel-macos-x86_64
Status changes
  • ERROR10 OK, 3 ERRORNow
  • ERROR12 OK, 1 ERROR2026-06-04
  • OK13 OK2026-05-30
  • ERROR10 OK, 3 ERROR2026-05-25
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.3.1
READMEYes · 756 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.3.1Citation fileYes · software entry onlyWebsiteYes · pkgdown
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%
Vignettes (1)

Downloads

4.4K
CRAN downloads in the past year
Rank #9,264 · ~12/day · ~364/mo
Daily download trend is not available in this view yet.
49230 days
1K90 days
4.4K1 year
Compare downloads with other packages →
Also on267 r2u8 autocran

Repository

11Stars
0Forks
0Open issues
0Open PRs
6Releases
138Commits
1Commit identities
License file reads as GPL-3.0 · 138 commits · Last activity 2026-09-24
Responsiveness
How these are sampled
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

2025-01-22 · 112026-07-07 · 11
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (2)
Code of conductContributing guide
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-09-24 · The repository has a site deploy workflow

pkgdown site last built 2026-09-24

Coverage (1)
Coverage reporting (Codecov)
Show all practicesHide 3 practices
CRAN release process (1)
cran-comments.md
Research and citation (1)
codemeta.json
Lint, format, editor (3)
AirVS CodeRStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
12 external dependencies (excludes base and recommended)

Installing cocoon adds 15 packages (9 with compiled code, 5.2 MB of source tarballs). Heaviest: vctrs 1.0 MB, dplyr 902 KB, rlang 766 KB.

Depends (0)
none
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.1.0 (2024), Copyright holder
Releases (5)

Pick two releases to compare their code metrics.

  • 0.3.1Latest
    record
    2026-06-28 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 0.3.0
    record
    2026-02-07 · diff ↗ ·
    added 1 export
    format_chisq
  • 0.2.1
    record
    2025-09-08 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • 0.2.0
    record
    2025-01-29 · diff ↗
  • 0.1.0
    record
    2024-11-05
  • R
    R 4.4.0 released · 2024-04-24

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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for cocoon version 0.3.1 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy