Software
rstudioapi

rstudioapi

Safely access RStudio's API (when available)

R

The rstudioapi package provides safe, conditional access to the RStudio IDE API for CRAN packages. It allows R package developers to integrate with RStudio features without causing R CMD check failures.

The package includes wrapper functions to check RStudio availability and version, call IDE functions conditionally, and provide graceful fallbacks when RStudio is not running. This solves the problem of writing packages that can leverage RStudio features (like the viewer pane or document manipulation) while remaining compatible with other R environments. Functions use explicit namespace calls (rstudioapi::) rather than attaching to the search path, making dependencies clear and avoiding naming conflicts.

Contributors