Skip to contents

stbl (development version)

New features

  • to_df() now handles atomic vectors provided as named objects (e.g. to_df(letters)) and provides informative error messages in additional cases, such as jagged lists (#203).
  • New stabilize_df() and specify_df() to validate data frame structure and contents (#142). to_df() coerces compatible inputs such as named lists to data frames.
  • New function to_df() (and synonym to_data_frame()) to coerce an object to a data frame (#201).
  • New stabilize_lst() and specify_lst() to validate list structure and contents and create pre-configured list validators for nested validation (#110).
  • New stabilize_present() validates that a value is non-NULL without imposing any type constraints (#110).
  • New expect_pkg_error_snapshot() function to snapshot-test the full error output of pkg_abort()-style errors in one step, combining expect_snapshot() with expect_pkg_error_classes() (#188).
  • New condition functions: pkg_abort() throws errors with a standardized, opinionated collection of classes, and expect_pkg_error_classes() checks that an error with the expected set of classes is thrown (#136).
  • New specification functions: specify_*() creates a “stbl-specified function” (class "stbl_specified_fn"), a call to the corresponding stabilize_*() function with arguments pre-filled. For example, stabilize_email <- specify_chr(regex = "^[^@]+@[^@]+\\.[^@]+$") creates a stabilize_email() function that calls stabilize_chr() with regex = "^[^@]+@[^@]+\\.[^@]+$", which could then be used to stabilize email addresses (#147, #148, #149, #150, #151).
  • New function to_lst() (and synonym to_list()) to coerce an object to a list, with conditional checks for NULL and functions (#157, #166).
  • New synonym functions for all class functions. For example to_character() is now a synonym for to_chr(), and specify_logical() is a synonym for specify_lgl() (#164). In addition, stabilise_*() synonyms have been added for all stabilize_*() functions (#167).

Breaking changes

Potential breaking changes

  • Several conditions that formerly included a subclass of “stbl-error-must” no longer include that subclass. This only occurs when “stbl-error-must” was not the most specific subclass (i.e., when a more specific subclass was already included), and therefore should not impact most if any code (#136).

Other changes

  • Revised the “Getting started with stbl” vignette to clarify what happens at each step (#139, #143, #144).
  • Clarified error messages (#176, #177).

stbl 0.2.0

CRAN release: 2025-09-16

New features

Minor improvements and fixes

  • Error messages are now clearer and more standardized throughout the package (#95).
  • to_*() functions now consistently flatten list-like inputs when no information would be lost in the process (#128).
  • to_fct() now lists the allowed values in its error message when a value is not in the expected set, making it easier to debug (#67).
  • to_lgl() now coerces character representations of numbers (e.g., “0” and “1”) to FALSE and TRUE respectively (#30).

Documentation

  • The purpose of and vision for this package are now more clearly described in documentation (#56, #77).
  • New vignette("stbl") provides an overview of the package and its functions (#42).

stbl 0.1.1

CRAN release: 2024-05-23

  • Update formatting in DESCRIPTION and examples.

stbl 0.1.0

  • Initial CRAN submission.