tidy-deprecate-function

Deprecate R functions and arguments with lifecycle warnings and documentation updates.

224|52|Updated Jun 10, 2020
One-click install
npx skills add https://github.com/r-lib/cpp11 --skill tidy-deprecate-function-r-lib
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tidy-deprecate-function
Source: https://github.com/r-lib/cpp11/tree/main/.claude/skills/tidy-deprecate-function
Command: npx skills add https://github.com/r-lib/cpp11 --skill tidy-deprecate-function-r-lib

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides you through deprecating functions or function arguments in an R package, ensuring consistent warnings, documentation, tests, and NEWS updates.

Core Features & Use Cases

  • Add deprecation warnings using lifecycle::deprecate_warn().
  • Silence deprecation warnings in existing tests.
  • Add lifecycle badge to package documentation.
  • Update NEWS.md with deprecation notes.
  • Create tests to verify deprecation messages.

Quick Start

Read DESCRIPTION to determine the deprecation version, insert lifecycle::deprecate_warn() into the target function, silence tests, update docs with a deprecation badge, and add a NEWS entry.

Frequently Asked Questions about tidy-deprecate-function

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deprecate an R function and its arguments safely?

To deprecate an R function safely, insert lifecycle::deprecate_warn() into the target function, update roxygen docs with a deprecated badge, silence existing tests, and record the change in NEWS.md.

What is the best way to add lifecycle warnings to an R package?

The best way to add lifecycle warnings in an R package is by using lifecycle::deprecate_warn(), which triggers a consistent deprecation message while ensuring users are notified of the function or argument's lifecycle status.

How do I calculate the deprecation version for an R package?

You calculate the deprecation version for an R package by reading the DESCRIPTION file to determine the current package version, which is then used to define the version when the function or argument was officially deprecated.

What steps are needed to update documentation when deprecating R functions?

Updating documentation when deprecating R functions requires adding a lifecycle deprecated badge to roxygen docs and incorporating migration examples to guide users toward the new alternative functions or arguments.

How do I record deprecated functions in NEWS.md?

To record deprecated functions in NEWS.md, add a deprecation note under the appropriate version section detailing which functions or arguments were deprecated, ensuring an auditable workflow of lifecycle changes.