Crosstables for Descriptive Analyses
Overview
Create descriptive tables for continuous and categorical variables. Apply summary statistics and counting function, with or without a grouping variable, and create beautiful reports using 'rmarkdown' or 'officer'. You can also compute effect sizes and statistical tests if needed.
New features
- New function
body_add_flextable2(): automatically adds a legend if theflextableobject has a"legend"attribute. Equivalent functionality is now available inbody_add_gg2(). (#100) - New argument
rename_with_labels(cols), more intuitive thanexcept. (#99) - New function
ct_bind_cols()helper to combine (column-bind) two multi-bycrosstables into a wider crosstable, enabling multi-column outputs with intra-group margins (**experimental**). (#97) - New argument
as_flextable(allow_breaks=FALSE), to avoid breaking a table group in 2 pages. (#92) - New argument
as_flextable(compact=TRUE, collapse), to collapse levels in compact format. (#98)
For example, collapse="Yes" will yield a single row for the "Yes" level, instead of a redundant Yes/No that sums up to 100%. This will only apply if there are 2 levels only, NA included. See examples for more.
Documentation
- New vignette on advanced customization, demonstrating how to plug custom summary functions, effect estimators and statistical tests into
crosstable(). (#112) - New hex logo! (#115)
Bug fixes and improvements
- Fixed
ct_compact()so that.idis kept in the output.
Show all changes in 0.9.0Hide the rest of the changes in 0.9.0
- Improved
format_fixed()for more reproducible output across platforms. This may result in minor rounding differences. (#114) - Fixed bug in
rename_with_labels()whenexceptcontainsc().(#99) - Fixed bug in
crosstable()when a factor variable hadNAas a level (like afterforcats::fct_value_to_na_level()). (#94) - Fixed
as_flextable()so thatcompact=TRUEworks in transposed (t()) crosstables (#91). - Fixed
as_flextable()so thatkeep_id=TRUEworks in multi-bycrosstables (#88).
Lifecycle
compact(), conflicting withpurrr::compact()and deprecated if favor ofct_compact()since 2022, has been removed from the package.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-29
- ERROR12 OK, 1 ERROR2026-07-23
- OK13 OK2026-07-19
Show 20 earlier changesHide 20 earlier changes
- ERROR12 OK, 1 ERROR2026-07-18
- OK13 OK2026-07-03
- ERROR12 OK, 1 ERROR2026-06-25
- OK13 OK2026-06-13
- ERROR12 OK, 1 ERROR2026-06-07
- OK13 OK2026-05-29
- ERROR12 OK, 1 ERROR2026-05-24
- OK13 OK2026-05-11
- ERROR12 OK, 1 ERROR2026-05-10
- OK13 OK2026-05-09
- ERROR12 OK, 1 ERROR2026-05-03
- OK13 OK2026-05-02
- ERROR11 OK, 1 ERROR2026-04-25
- OK14 OK2026-04-11
- ERROR13 OK, 1 ERROR2026-04-09
- OK14 OK2026-04-07
- ERROR13 OK, 1 ERROR2026-04-04
- OK14 OK2026-03-25
- ERROR13 OK, 1 ERROR2026-03-22
- OK14 OK2026-03-10
Documentation
- Help pages
- 60 (2 internal)includes a package overview page
- Examples that run
- 97%34 run in a plain check · 1 never run
- Exported functions with examples
- 58%
- Documented parameters
- 92%
- Return-value docs
- 98%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 78%
- Median days to close, 50 most recently updated closed issues
- 63
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
14 development-tooling and community-health practices detected across 8 families in the upstream repository
Checks run against github.com/danchaltiel/crosstable on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-14 · The repository has a site deploy workflow
pkgdown site last built 2026-09-14
Show all practicesHide 4 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2026-09-14Pull request: opened by its own accountCommits: 1 by its own account · at least 1 crediting it in the message
Dependencies
Installing crosstable adds 61 packages (38 with compiled code, 54 MB of source tarballs). Heaviest: stringi 11 MB, data.table 5.7 MB, bslib 5.6 MB.
CRAN will archive these unless their check problems are fixed by the date shown. This package needs each one to install.
- flextablefix by Oct 22
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 0.9.0Latest2026-03-15 · current release · diff ↗ ·
removed 1 export
compactadded 2 exports
body_add_flextable2, ct_bind_cols - 0.8.22025-09-08 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.8.12024-11-01 · diff ↗
- 0.8.02024-09-30 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.7.0
- unarchivedReturned to CRAN2023-05-29
- 0.6.22023-05-29 · diff ↗
- archivedRemoved from CRAN2023-05-20issues were not corrected in time
- RR 4.3.0 released · 2023-04-21
- 0.6.12023-04-04 · diff ↗
- 0.6.02023-03-26 · diff ↗ ·
added 7 exports
body_add_table_list, get_percent_pattern, is.compacted_crosstable, is.multiby_crosstable, is.transposed_crosstable, pivot_crosstable, transpose_crosstable - 0.5.02022-08-16 · diff ↗ ·
added 5 exports
clean_names_with_labels, crosstable_reset_options, ct_compact, narm, rename_with_labels - RR 4.2.0 released · 2022-04-22
Show 10 earlier eventsHide 10 earlier events
- 0.4.12022-02-25 · diff ↗
- unarchivedReturned to CRAN2022-02-14
- 0.4.02022-02-14 · diff ↗
- archivedRemoved from CRAN2022-02-06check problems were not corrected in time
- 0.3.22021-11-27 · diff ↗ ·
added 3 exports
body_replace_text_at_bkms, crosstable_options, crosstable_peek_options - 0.3.12021-11-14 · diff ↗ ·
added 3 exports
body_add_crosstable_list, body_add_flextable_list, is.crosstable - 0.2.2
- RR 4.1.0 released · 2021-05-18
- 0.2.12021-03-08
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2021-03-08
- Total releases
- 15 / 5 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 3.6.0
- Bundled data
- 2.9 KB / 2 files
- Download size
- 1.4 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("crosstable")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.