Check User-Supplied Function Arguments
Overview
For developers to check user-supplied function arguments. It is designed to be simple, fast and customizable. Error messages follow the tidyverse style guide.
Breaking changes
- chk now requires R >= 4.1.
check_data()andcheck_values()now require the levels of a factor column to be identical (including order) to the levels ofvalueswhenevervalueshas two or more levels; previously two levels only required an ordered superset (#297).check_data()andcheck_values()now require all values of a column to be missing when the correspondingvaluesare all missing.
New features
- New
chk_all_na()andvld_all_na()check that all values are missing (#299). - New
chk_class()andvld_class()check that an object inherits from a class usinginherits()regardless of the object system. - New
chk_s3_class_strict()andvld_s3_class_strict()check that an object is an S3 object of the given class (excluding S4, R5, R6 and S7 objects). - New
chk_r6_class()andvld_r6_class()check that an object is an R6 object of the given class (#306). - New
generate_check_data()generates the code for acheck_data()call from an example data frame (#124). chk_s3_class()andchk_s4_class()errors now state the class(es) of the object to help diagnose issues.chkor_vld()gains anx_nameargument that is passed to each of the underlyingchk_calls, so the error message refers tox_namerather than the deparsedvld_arguments (#100).
Show all changes in 0.11.0Hide the rest of the changes in 0.11.0
vld_s4_class()is now vectorized overclasslikevld_s3_class(), sochk_s4_class()accepts multiple classes.message_chk()gains a%essprintf-like type (for pluralizing words such as class/classes) and treats%%as an escape for a literal '%' (#310).p()andp0()gain arecycle0argument that is passed topaste()andpaste0()(#307).
Bug fixes
check_data()now names the offending argument when passed a non-data frame, instead of reporting "data.frame".chk_lte()now sets thexandvaluefields on its condition for scalar input, consistent withchk_gte(),chk_lt()andchk_gt().chk_null_or()now resolves the matchingchk_function by direct lookup (includingchk_/vld_pairs defined in other packages) rather than byparse()/eval(), and falls back to an informative message when no partner can be found (#97).deparse_backtick_chk()now usesdeparse1()so thatx_nameis a string for arguments whose expressions deparse over multiple lines; previously such calls failed with `x_namemust be a string` (#300).
Documentation
check_data()now documents that it does not check for duplicate rows and thatunique()should be used to detect them (#309).
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-07
- NOTE11 OK, 2 NOTE2026-07-16
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 100 (4 internal)includes a package overview page
- Examples that run
- 100%98 run in a plain check (1 of them under a condition)
- Exported functions with examples
- 100%
- Documented parameters
- 99%
- Return-value docs
- 100%
- Help pages citing references
- 0%
- Get Started with chk HTML
- chk Families HTML
Downloads
Repository
- PRs merged (all time)
- 73%
- Median days to close, 50 most recently updated closed issues
- 47
- 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
15 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/poissonconsulting/chk on 2026-10-22.
GitHub Pages site last deployed 2026-10-14
pkgdown site last built 2026-09-03
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2025-11-19Pull request: opened by its own account
- Claude Codefirst seen 2026-05-16Named in .Rbuildignore: .claudePull request it wrote: opened by a project memberCommits: at least 36 crediting it in the message
- Claude Opus 4.815 commits · Jun 2026
- Claude Opus 510 commits · Aug to Sep 2026
- Claude Fable 54 commits · Jul 2026
- Claude Opus 5.54 commits · Oct 2026
- Claude Fable 5.12 commits · Sep 2026
Dependencies
Installing chk adds 3 packages (2 with compiled code, 1.5 MB of source tarballs). Heaviest: rlang 766 KB, cli 629 KB, lifecycle 105 KB.
Show all 31 packagesHide all 31 packages
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.11.0Latest2026-09-03 · current release · diff ↗ ·
added 9 exports
chk_all_na, chk_class, chk_r6_class, chk_s3_class_strict, generate_check_data, vld_all_na, vld_class, vld_r6_class, vld_s3_class_strict - RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 0.10.02025-01-24 · diff ↗ ·
added 7 exports
check_length, chk_complex, chk_complex_number, chk_raw, vld_complex, vld_complex_number, vld_raw - 0.9.22024-07-09 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.9.12023-10-06 · diff ↗
- 0.9.0
- RR 4.3.0 released · 2023-04-21
- 0.8.1
- RR 4.2.0 released · 2022-04-22
- 0.8.0
- 0.7.0
- 0.6.02021-07-04 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 0.5.12020-07-24 · diff ↗
Show 8 earlier eventsHide 8 earlier events
- 0.5.02020-05-29 · diff ↗ ·
added 19 exports
check_dirs, check_files, chk_character_or_factor, chk_chr, chk_date_time, chk_dbl, chk_factor, chk_not_subset, chk_null_or, chk_orderset, chk_wnum, vld_character_or_factor, vld_chr, vld_date_time, vld_dbl, vld_factor, vld_not_subset, vld_orderset, vld_wnum - RR 4.0.0 released · 2020-04-24
- 0.4.02020-03-04 · diff ↗ ·
added 17 exports
check_data, check_dim, check_key, check_names, check_values, chk_character, chk_data, chk_double, chk_integer, chk_join, chk_logical, vld_character, vld_data, vld_double, vld_integer, vld_join, vld_logical - 0.3.12020-02-05 · diff ↗ ·
added 7 exports
chk_array, chk_matrix, chk_tz, expect_chk_error, vld_array, vld_matrix, vld_tz - 0.3.0
- 0.2.12019-11-26 · diff ↗
- 0.2.02019-11-15
- RR 3.6.0 released · 2019-04-26
Package metadata
- First published
- 2019-11-15
- Total releases
- 16 / 7 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1
- Download size
- 687 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("chk")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-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.