chk

An R package for developers to check user-supplied function arguments

https://github.com/poissonconsulting/chk

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.1%) to scientific vocabulary

Keywords

chk cran rstats

Keywords from Contributors

assertions standards checkr species-sensitivity-distribution ecotoxicology kootenay-lake fish geo interpretability gdal
Last synced: 10 months ago · JSON representation

Repository

An R package for developers to check user-supplied function arguments

Basic Info
Statistics
  • Stars: 50
  • Watchers: 3
  • Forks: 5
  • Open Issues: 5
  • Releases: 6
Topics
chk cran rstats
Created almost 7 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Support

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# chk chk logo of completed tick mark


[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![R-CMD-check](https://github.com/poissonconsulting/chk/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/poissonconsulting/chk/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/poissonconsulting/chk/graph/badge.svg)](https://app.codecov.io/gh/poissonconsulting/chk)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/license/mit)
[![CRAN status](https://www.r-pkg.org/badges/version/chk)](https://cran.r-project.org/package=chk)
![CRAN downloads](https://cranlogs.r-pkg.org/badges/chk)


`chk` is an R package for developers to check user-supplied function arguments.

It is designed to be simple, customizable and fast.

## Demonstration

`chk` provides simple commonly used checks as (`chk_` functions) which can be combined together for more complex checking.

```{r, error = TRUE}
library(chk)

y <- "a"

chk_string(y)
chk_flag(y)

data <- data.frame(x = 1:2)
chk_range(nrow(data), c(3, 8))
```

Or used inside functions to test user-provided arguments.

```{r, error = TRUE}
my_fun <- function(x) {
  chk_flag(x)
  x
}
my_fun(TRUE)
my_fun(NA)
```

Error messages follow the [tidyverse style guide](https://style.tidyverse.org/errors.html) while the errors themselves are [rlang errors](https://rlang.r-lib.org/reference/abort.html) of class `chk_error`.

## Information

For more information see the [Get Started](https://poissonconsulting.github.io/chk/articles/chk.html) vignette.

## Installation

### Release

To install the release version from [CRAN](https://CRAN.R-project.org/package=chk).
```r
install.packages("chk")
```

The website for the release version is at .

### Development

To install the development version from [GitHub](https://github.com/poissonconsulting/chk)
```r
# install.packages("remotes")
remotes::install_github("poissonconsulting/chk")
```

or from [r-universe](https://poissonconsulting.r-universe.dev/chk).
```r
install.packages("chk", repos = c("https://poissonconsulting.r-universe.dev", "https://cloud.r-project.org"))
```

## Inspiration

- [datacheckr](https://github.com/poissonconsulting/datacheckr/)
- [checkr](https://github.com/poissonconsulting/checkr/)
- [err](https://github.com/poissonconsulting/err/)
- [testthat](https://github.com/r-lib/testthat/)

## Contribution

Please report any [issues](https://github.com/poissonconsulting/chk/issues).

[Pull requests](https://github.com/poissonconsulting/chk/pulls) are always welcome.

## Code of Conduct

Please note that the chk project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.

Owner

  • Name: Poisson Consulting Ltd.
  • Login: poissonconsulting
  • Kind: organization
  • Email: software@poissonconsulting.ca
  • Location: Nelson, BC, Canada

Computational Biology and Statistical Ecology

GitHub Events

Total
  • Create event: 51
  • Issues event: 11
  • Release event: 2
  • Watch event: 2
  • Delete event: 37
  • Issue comment event: 36
  • Push event: 184
  • Pull request event: 99
  • Pull request review event: 39
  • Pull request review comment event: 5
  • Fork event: 1
Last Year
  • Create event: 51
  • Issues event: 11
  • Release event: 2
  • Watch event: 2
  • Delete event: 37
  • Issue comment event: 36
  • Push event: 184
  • Pull request event: 99
  • Pull request review event: 39
  • Pull request review comment event: 5
  • Fork event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 938
  • Total Committers: 11
  • Avg Commits per committer: 85.273
  • Development Distribution Score (DDS): 0.294
Past Year
  • Commits: 156
  • Committers: 6
  • Avg Commits per committer: 26.0
  • Development Distribution Score (DDS): 0.513
Top Committers
Name Email Commits
joethorley j****e@p****a 662
Ayla Pearson a****3@g****m 126
Kirill Müller k****r@m****g 93
Evan e****i@g****m 15
Florencia D'Andrea f****a@g****m 15
Nadine Hussein n****3@g****m 12
github-actions[bot] 4****] 9
Duncan Kennedy d****n@p****a 2
GitHub Actions a****s@g****m 2
Maëlle Salmon m****n@y****e 1
Mowahid Latif m****f@M****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 91
  • Total pull requests: 158
  • Average time to close issues: 3 months
  • Average time to close pull requests: 3 days
  • Total issue authors: 14
  • Total pull request authors: 9
  • Average comments per issue: 1.82
  • Average comments per pull request: 0.32
  • Merged pull requests: 112
  • Bot issues: 1
  • Bot pull requests: 58
Past Year
  • Issues: 3
  • Pull requests: 108
  • Average time to close issues: about 24 hours
  • Average time to close pull requests: 3 days
  • Issue authors: 3
  • Pull request authors: 5
  • Average comments per issue: 1.33
  • Average comments per pull request: 0.31
  • Merged pull requests: 71
  • Bot issues: 1
  • Bot pull requests: 52
Top Authors
Issue Authors
  • joethorley (63)
  • krlmlr (10)
  • ngreifer (4)
  • aylapear (4)
  • barracuda156 (1)
  • flor14 (1)
  • pkrog (1)
  • NewGraphEnvironment (1)
  • github-actions[bot] (1)
  • evanamiesgalonski (1)
  • moodymudskipper (1)
  • Farbfetzen (1)
  • harell (1)
  • lionel- (1)
Pull Request Authors
  • github-actions[bot] (58)
  • krlmlr (42)
  • joethorley (25)
  • aylapear (9)
  • flor14 (8)
  • evanamiesgalonski (8)
  • nadinehussein (5)
  • maelle (2)
  • MowahidLatif (1)
Top Labels
Issue Labels
Type: Docs (11) Priority: 2 High (7) Type: Enhancement (6) Type: Refactor (5) Difficulty: 1 Simple (5) Type: Testing (4) Effort: 2 Medium (4) Effort: 1 Low (4) Difficulty: 2 Intermediate (3) Priority: 3 Medium (3) Effort: 3 High (3) Difficulty: 3 Advanced (3) Type: Bug (2) Effort: Medium (2) Importance: High (2) upkeep (1) Type: Feature (1) Timeline: Now (1) Difficulty: Advanced (1) Timeline: Soon (1) Difficulty: Intermediate (1) Priority: 1 Critical (1)
Pull Request Labels
CRAN release :station: (2)

Packages

  • Total packages: 2
  • Total downloads:
    • cran 14,140 last-month
  • Total docker downloads: 42,041
  • Total dependent packages: 28
    (may contain duplicates)
  • Total dependent repositories: 70
    (may contain duplicates)
  • Total versions: 20
  • Total maintainers: 1
cran.r-project.org: chk

Check User-Supplied Function Arguments

  • Versions: 15
  • Dependent Packages: 28
  • Dependent Repositories: 70
  • Downloads: 14,140 Last month
  • Docker Downloads: 42,041
Rankings
Docker downloads count: 0.6%
Dependent packages count: 2.8%
Dependent repos count: 2.9%
Downloads: 3.7%
Average: 5.8%
Stargazers count: 7.6%
Forks count: 17.0%
Maintainers (1)
Last synced: 10 months ago
conda-forge.org: r-chk
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Stargazers count: 39.6%
Average: 44.8%
Dependent packages count: 51.2%
Forks count: 54.2%
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4 depends
  • lifecycle * imports
  • methods * imports
  • rlang * imports
  • tools * imports
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 3.0.0 suggests
  • withr * suggests
.github/workflows/R-CMD-check.yaml actions
  • 8398a7/action-slack v3.0.0 composite
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite