Skip to content

Stabilize Objects

1packages dependsuggested by 1
13.6Kdownloads / year
99.7%test coverage
13/13flavors OK

Overview

About

A set of consistent, opinionated functions to quickly check objects, coerce them to the desired configuration, or deliver informative error messages when that is not possible.

Changes in 0.5.0

Breaking changes

  • stabilize_present() is now named assert_present(), since it doesn't stabilize (coerce) its input; it only asserts that the input is not NULL. Calling stabilize_present() now throws a "deprecated"-classed error directing you to assert_present() (#299).
  • expect_pkg_error_snapshot(), expect_pkg_message_snapshot(), and expect_pkg_warning_snapshot() now produce snapshots that mirror testthat::expect_snapshot(), showing the bare expression under Code and the condition class alongside its message (#301). Error messages for element-wise and incompatible-value failures also now list the failing locations and, where relevant, values, and the condition objects carry matching locations and values elements (#274, #332). Existing snapshots of these messages must be re-accepted; use testthat::skip_if_not_installed("stbl", minimum_version = "0.5.0") to skip such tests with older versions of {stbl}.

New features

  • New assertion functions assert_not() and assert_contains(): assert_not() errors when x would be accepted (coerced or validated) by a single spec, and assert_contains() checks that the number of elements matching a spec falls within a given range (#289, #290).
  • New functions ignore_stbl_error() and replace_stbl_error() catch a {stbl} error of a given subclass (defaulting to any {stbl} error). ignore_stbl_error() returns NULL, allowing callers to suppress expected validation failures; replace_stbl_error() replaces the error's message with a custom one, with an optional additional_class argument to prepend extra classes to the error class list (#178, #334).
  • New "meta-stabilizer" functions compose other stabilizers and specs: stabilize_all_of() requires every stabilizer in ... to succeed, stabilize_any_of() returns the first successful result, stabilize_one_of() requires exactly one success, and stabilize_each() applies a single spec to every element. Matching to_*() and specify_*() variants are also available (#215, #278, #285, #286, #287, #288).
  • The stabilize_*() and specify_*() functions gain new constraint arguments: min_characters/max_characters for character vectors (#275), allowed_values to restrict input to a fixed set of permitted values (#282), exclusive_min_value/exclusive_max_value for strict numeric bounds (#276), multiple_of to require values that are a multiple of a given value (#283), and unique/.unique to reject duplicate elements (#280). See each function's documentation for details.
  • New date, dttm, time, and dur function families (to_date(), stabilize_date(), to_dttm(), stabilize_dttm(), to_time(), stabilize_time(), to_dur(), stabilize_dur(), plus matching specify_*() factories) validate and coerce RFC 3339 / ISO 8601 temporal values. stabilize_date() and stabilize_dttm() also accept unambiguous locale-dependent formats via a new accepted_datetime_formats argument and the locale_datetime_formats() helper (#104, #105, #294, #295, #326).
  • stabilize_df() and stabilize_lst() (and their specify_*() factories) are more flexible about named elements: .required marks named specs as optional (#279), .extra_cols/.named/.unnamed accept TRUE to allow extra or unnamed elements unchecked (#281), and .allow_zero_length lets a zero-length input skip the required-element check (#344).

Bug fixes

  • stabilize_lst() (and stabilize_df(), which delegates to it) now correctly detects missing required named elements even when .x has no named elements at all, such as list() or list(1L, 2L). Previously, the required-element check was silently skipped whenever .x had no named elements (#344).
Show all changes in 0.5.0Hide the rest of the changes in 0.5.0
  • to_chr(), to_dbl(), to_fct(), to_int(), and to_lgl() now throw an informative "incompatible values" error listing the failing locations and values when a list contains elements that can't be converted, instead of a generic "can't coerce" error (#273, #335).
  • stabilize_*(NULL, allow_null = TRUE) always returns NULL, without checking other stabilize_*() rules. For example, stabilize_int(NULL, min_value = 1) now returns NULL, rather than erroring (#353).

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 5.9 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-10-15
  • ERROR12 OK, 1 ERROR2026-10-14
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-09
Show 2 earlier changesHide 2 earlier changes
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.5.0
READMEYes · 469 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.5.0Citation fileNoWebsiteYes · pkgdown
Help pages
237 (151 internal)includes a package overview page
Examples that run
100%82 run in a plain check (3 of them under a condition)
Exported functions with examples
92%
Documented parameters
100%
Return-value docs
98%
Help pages citing references
0%

Downloads

13.6K
CRAN downloads in the past year
Rank #2,936 · ~37/day · ~1.1K/mo
Daily download trend is not available in this view yet.
1.7K30 days
4.8K90 days
13.6K1 year
Compare downloads with other packages →
Also on184 r2u4 autocran

Repository

18Stars
0Forks
11Open issues
0Open PRs
5Releases
250Commits
3Commit identities
250 commits · Last activity 2026-10-22 · 0% stars, 30d · Default branch at 0.5.0.9001, ahead of CRAN 0.5.0 (checked 2026-10-21)
Responsiveness
How these are sampled
PRs merged (all time)
98%
Median days to close, 50 most recently updated closed issues
5
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-09-17 · 162026-09-17 · 18
PracticesBeta

16 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/wranglezone/stbl on 2026-10-21.

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 (4)
Code of conductContributing guideIssue templatesSupport guide
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-10-02 · The repository has a site deploy workflow

pkgdown site last built 2026-09-13

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

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-02-02
    Named in .Rbuildignore: .claude
  • GitHub Copilotfirst seen 2026-03-18
    Seen in the repository: .github/copilot-instructions.md, .github/skills, .github/workflows/copilot-setup-steps.yml
    Pull request: opened by its own account
    Commits: 25 by its own account · at least 24 crediting it in the message
Shared conventions any agent may read, so they name no particular tool.
Seen in the repository: AGENTS.md
Review tools
  • Copilot code review
    Commits: at least 8 accepting its review suggestions
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
12 external dependencies (excludes base and recommended)

Installing stbl adds 5 packages (4 with compiled code, 2.6 MB of source tarballs). Heaviest: vctrs 1.0 MB, rlang 766 KB, cli 629 KB.

Depends (1)
R >= 4.1
Imports (5)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Imports 1
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

People & History

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

Pick two releases to compare their code metrics.

  • 0.5.0Latest
    record
    2026-09-13 · current release · diff ↗ ·
    added 68 exports
    assert_contains, assert_not, assert_present, ignore_stbl_error, locale_datetime_formats, replace_stbl_error, specify_all_of, specify_any_of, specify_date, specify_date_scalar, specify_datetime, specify_datetime_scalar, specify_dttm, specify_dttm_scalar, specify_dur, specify_dur_scalar, specify_duration, specify_duration_scalar, specify_each, specify_one_of, specify_time, specify_time_scalar, stabilise_all_of, stabilise_any_of, stabilise_date, stabilise_date_scalar, stabilise_datetime, stabilise_datetime_scalar, stabilise_dttm, stabilise_dttm_scalar and 38 more
  • 0.4.0
    record
    2026-07-28 · diff ↗ ·
    added 13 exports
    are_fn_ish, are_function_ish, expect_pkg_message_classes, expect_pkg_message_snapshot, expect_pkg_warning_classes, expect_pkg_warning_snapshot, is_fn_ish, is_function_ish, pkg_inform, pkg_warn, to, to_fn, to_function
  • R
    R 4.6.0 released · 2026-04-24
  • 0.3.0
    record
    2026-04-04 · diff ↗ ·
    added 91 exports
    !!, are_character_ish, are_double_ish, are_factor_ish, are_integer_ish, are_logical_ish, expect_pkg_error_classes, expect_pkg_error_snapshot, is_character_ish, is_double_ish, is_factor_ish, is_integer_ish, is_logical_ish, pkg_abort, specify_character, specify_character_scalar, specify_chr, specify_chr_scalar, specify_data_frame, specify_dbl, specify_dbl_scalar, specify_df, specify_double, specify_double_scalar, specify_factor, specify_factor_scalar, specify_fct, specify_fct_scalar, specify_int, specify_int_scalar and 61 more
  • 0.2.0
    record
    2025-09-16 · diff ↗ ·
    added 16 exports
    are_chr_ish, are_dbl_ish, are_fct_ish, are_int_ish, are_lgl_ish, is_chr_ish, is_dbl_ish, is_fct_ish, is_int_ish, is_lgl_ish, regex_must_match, regex_must_not_match, stabilize_dbl, stabilize_dbl_scalar, to_dbl, to_dbl_scalar
  • R
    R 4.5.0 released · 2025-04-11
  • 0.1.1
    record
    2024-05-23
  • R
    R 4.4.0 released · 2024-04-24

Package metadata

First published
2024-05-23
Total releases
5 / 2 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1
Download size
845 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("stbl")
Harmon, J. (2026). stbl: Stabilize Objects (Version 0.5.0) [Computer software]. https://doi.org/10.32614/CRAN.package.stbl

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 stbl version 0.5.0 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-23, 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