Skip to content

Check User-Supplied Function Arguments

30packages dependsuggested by 1
238.8Kdownloads / year
97.4%test coverage
13/13flavors OK

Overview

About
Maintained by Joe ThorleyCRAN page ↗GitHub ↗Website ↗Issues ↗Declared funder: Poisson Consulting

For developers to check user-supplied function arguments. It is designed to be simple, fast and customizable. Error messages follow the tidyverse style guide.

Changes in 0.11.0

Breaking changes

  • chk now requires R >= 4.1.
  • check_data() and check_values() now require the levels of a factor column to be identical (including order) to the levels of values whenever values has two or more levels; previously two levels only required an ordered superset (#297).
  • check_data() and check_values() now require all values of a column to be missing when the corresponding values are all missing.

New features

  • New chk_all_na() and vld_all_na() check that all values are missing (#299).
  • New chk_class() and vld_class() check that an object inherits from a class using inherits() regardless of the object system.
  • New chk_s3_class_strict() and vld_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() and vld_r6_class() check that an object is an R6 object of the given class (#306).
  • New generate_check_data() generates the code for a check_data() call from an example data frame (#124).
  • chk_s3_class() and chk_s4_class() errors now state the class(es) of the object to help diagnose issues.
  • chkor_vld() gains an x_name argument that is passed to each of the underlying chk_ calls, so the error message refers to x_name rather than the deparsed vld_ arguments (#100).
Show all changes in 0.11.0Hide the rest of the changes in 0.11.0
  • vld_s4_class() is now vectorized over class like vld_s3_class(), so chk_s4_class() accepts multiple classes.
  • message_chk() gains a %es sprintf-like type (for pluralizing words such as class/classes) and treats %% as an escape for a literal '%' (#310).
  • p() and p0() gain a recycle0 argument that is passed to paste() and paste0() (#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 the x and value fields on its condition for scalar input, consistent with chk_gte(), chk_lt() and chk_gt().
  • chk_null_or() now resolves the matching chk_ function by direct lookup (including chk_/vld_ pairs defined in other packages) rather than by parse()/eval(), and falls back to an informative message when no partner can be found (#97).
  • deparse_backtick_chk() now uses deparse1() so that x_name is a string for arguments whose expressions deparse over multiple lines; previously such calls failed with ` x_name must be a string ` (#300).

Documentation

  • check_data() now documents that it does not check for duplicate rows and that unique() should be used to detect them (#309).

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 2.4 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-09-07
  • NOTE11 OK, 2 NOTE2026-07-16
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.11.0
READMEYes · 196 wordsVignettesYes · 2 · dynamicNEWSYes · 100% structured · mentions 0.11.0Citation fileNoWebsiteYes · pkgdown
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%

Downloads

238.8K
CRAN downloads in the past year
Rank #1,029 · ~654/day · ~19.9K/mo
Daily download trend is not available in this view yet.
7.5K30 days
38K90 days
238.8K1 year
Compare downloads with other packages →
Also on3.8K r2u13 autocran4.6K conda_forge347 c2d4u

Repository

50Stars
5Forks
7Open issues
0Open PRs
7Releases
1,232Commits
13Commit identities
rstatschkcran
1,232 commits · Last activity 2026-10-14 · 0% stars, 30d · Default branch at 0.11.0.9005, ahead of CRAN 0.11.0 (checked 2026-10-22)
Responsiveness
How these are sampled
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

2025-07-29 · 502026-09-04 · 50
PracticesBeta

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.

Continuous integration (1)
GitHub Actions
Governance and community (4)
Code of conductContributing guideCODEOWNERSSupport guide
Docs source (3)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-14

pkgdown site last built 2026-09-03

Coverage (2)
Coverage reporting (Codecov).covrignore
Show all practicesHide 2 practices
CRAN release process (2)
cran-comments.mdrevdep/
Lint, format, editor (3)
AirVS CodeRStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • GitHub Copilotfirst seen 2025-11-19
    Pull request: opened by its own account
  • Claude Codefirst seen 2026-05-16
    Named in .Rbuildignore: .claude
    Pull request it wrote: opened by a project member
    Commits: at least 36 crediting it in the message
Models named in its commits
  • 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
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
9 external dependencies (excludes base and recommended)

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.

Depends (1)
R >= 4.1
Imports (4)
lifecyclemethodsrlangtools
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
30direct
4indirect
Imports 30
Suggested by 1
Show all 31 packagesHide all 31 packages
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

People & History

People (8)
Author, Maintainer since 0.2.0 (2019)
Author · added in 0.6.0
Contributor · added in 0.8.0
Contributor · added in 0.10.0
Contributor · added in 0.6.0
Contributor · added in 0.11.0
Copyright holder, Funder
Releases (16)

Pick two releases to compare their code metrics.

  • 0.11.0Latest
    record
    2026-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
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • 0.10.0
    record
    2025-01-24 · diff ↗ ·
    added 7 exports
    check_length, chk_complex, chk_complex_number, chk_raw, vld_complex, vld_complex_number, vld_raw
  • 0.9.2
    record
    2024-07-09 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • 0.9.1
    record
    2023-10-06 · diff ↗
  • 0.9.0
    record
    2023-05-27 · diff ↗ ·
    added 2 exports
    chk_compatible_lengths, vld_compatible_lengths
  • R
    R 4.3.0 released · 2023-04-21
  • 0.8.1
    record
    2022-08-26 · diff ↗ ·
    added 4 exports
    chk_missing, chk_not_missing, vld_missing, vld_not_missing
  • R
    R 4.2.0 released · 2022-04-22
  • 0.8.0
    record
    2022-02-05 · diff ↗ ·
    added 2 exports
    chk_valid_name, vld_valid_name
  • 0.7.0
    record
    2021-09-04 · diff ↗ ·
    added 3 exports
    chkor_vld, vld_count, vld_length
  • 0.6.0
    record
    2021-07-04 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • 0.5.1
    record
    2020-07-24 · diff ↗
Show 8 earlier eventsHide 8 earlier events
  • 0.5.0
    record
    2020-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
  • R
    R 4.0.0 released · 2020-04-24
  • 0.4.0
    record
    2020-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.1
    record
    2020-02-05 · diff ↗ ·
    added 7 exports
    chk_array, chk_matrix, chk_tz, expect_chk_error, vld_array, vld_matrix, vld_tz
  • 0.3.0
    record
    2020-01-15 · diff ↗ ·
    added 2 exports
    chk_sorted, vld_sorted
  • 0.2.1
    record
    2019-11-26 · diff ↗
  • 0.2.0
    record
    2019-11-15
  • R
    R 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")
Thorley, J., Poisson Consulting, Amies-Galonski, E., D'Andrea, F., Hussein, N., Mezzini, S., Müller, K., & Pearson, A. (2026). chk: Check User-Supplied Function Arguments (Version 0.11.0) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

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

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.

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