stbl0.2.0 package

Stabilize Function Arguments

are_chr_ish

Check if an object can be safely coerced to character

are_dbl_ish

Check if an object can be safely coerced to double

are_fct_ish

Check if an object can be safely coerced to a factor

are_int_ish

Check if an object can be safely coerced to integer

dot-check_size

Check the size of an object

dot-stop_must

Abort with a standardized "must" message

dot-stop_null

Abort because an argument must not be NULL

regex_must_match

Create a regex matching rule

regex_must_not_match

Create a 'must not match' regex rule

dot-check_value_chr

Check character values against one or more regex patterns

dot-check_value_dbl

Check double values against min and max values

dot-check_x_no_more_than_y

Check that one value is not greater than another

dot-cli_escape

Escape curly braces for safe printing with cli

dot-cli_mark

Wrap text in cli markup

dot-coerce_fct_levels_impl

Core implementation for applying factor levels

dot-coerce_fct_levels

Coerce to factor with specified levels

dot-coerce_fct_to_na

Coerce specified values to NA

dot-compile_error_class

Compile an error class

dot-define_main_msg

Define the main error message for a "must" error

dot-describe_failure_chr

Describe a character-based validation failure

dot-elements_are_cls_ish

Check if all elements of a list-like object are ish

dot-fast_false

Always return FALSE

dot-find_failures

Safely find failure locations in a vector

dot-glue2

A wrapper for glue::glue with custom delimiters

dot-has_regex_pattern

Detect a regex pattern in a character vector

dot-is_allowed_null

Check if a value is NULL and NULLs are allowed

dot-shared-params-check

Shared parameters for check functions

dot-shared-params

Shared parameters

dot-stabilize_cls_scalar

Stabilize a scalar object of a specific class

dot-stabilize_cls

Stabilize an object of a specific class

dot-stbl_abort

Signal an error with standards applied

dot-stop_bad_levels

Stop for bad factor levels

dot-stop_cant_coerce

Abort with a standardized "can't coerce" message

dot-stop_incompatible

Abort with an "incompatible type" message

reexports

Objects exported from other packages

are_lgl_ish

Check if an object can be safely coerced to logical

dot-apply_regex_rule

Apply a single regex rule to a character vector

dot-are_not_dbl_ish_chr

Check for character to double coercion failures

dot-are_not_fct_ish_chr

Check for values that would be lost during factor coercion

dot-are_not_int_ish_chr

Check for character to integer coercion failures

dot-check_cast_failures

Check for coercion failures and stop if any are found

dot-check_chr_to_int_failures

Check for character to integer coercion failures

dot-check_na

Check for NA values

dot-check_scalar

Check if an object is a scalar

dot-to_cls_from_fct

Coerce an object from a factor to a specific class

dot-to_cls_from_list

Coerce a list to a specific class

dot-to_cls_scalar

Coerce an object to a specific scalar class

dot-to_null

Ensure an argument is NULL

dot-to_num_from_complex

Coerce an object from a complex to a numeric class

grapes-and-and-grapes

NULL-coalescing-like operator

object_type

Identify the class, type, etc of an object

stabilize_arg

Ensure an argument meets expectations

stabilize_chr

Ensure a character argument meets expectations

stabilize_dbl

Ensure a double argument meets expectations

stabilize_fct

Ensure a factor argument meets expectations

stabilize_int

Ensure an integer argument meets expectations

stabilize_lgl

Ensure a logical argument meets expectations

stbl-package

stbl: Stabilize Function Arguments

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

  • Maintainer: Jon Harmon
  • License: MIT + file LICENSE
  • Last published: 2025-09-16