talira

lifecycle

Tools and conventions for managing the life cycle of an R package's functions

open sourceMITfree

lifecycle is an open source R package from Posit's r-lib team with tools and conventions for managing the life cycle of a package's exported functions and arguments: marking them experimental, stable, deprecated or superseded. Package authors use it to deprecate functions and arguments with soft warnings, warnings or errors and to add lifecycle badges to their documentation; package users can see their last deprecation warnings and lint their code for functions that aren't stable.

Problems it solves

  • deprecate a function in my R package with a warning that tells users what to use instead
  • mark functions in my R package as experimental or superseded
  • find code that calls deprecated tidyverse functions

Features

  • deprecate functions and arguments with deprecate_soft, deprecate_warn and deprecate_stop
  • mark an argument as deprecated with deprecated() and is_present()
  • lifecycle badges for documentation
  • testthat expectations for deprecation warnings and defunct errors
  • show the last lifecycle warnings
  • lint code for functions with a non-stable life cycle
  • control how verbose deprecation signals are