# rstudioapi

> Safely call the RStudio IDE's API from R packages

Source: https://talira.ai/catalog/rstudioapi-hq1v8690
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / general purpose](https://talira.ai/categories/libraries/general-purpose), [languages / r](https://talira.ai/categories/languages/r)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Posit](https://talira.ai/orgs/posit.md)

rstudioapi is an R package from Posit that lets code, including CRAN packages, call the [RStudio](https://talira.ai/catalog/rstudio-1d5e9y7d.md) IDE's API when it's available and get an informative error when it isn't, so packages that use it still pass R CMD check outside RStudio. It wraps the API in a handful of functions that are always called with the rstudioapi:: prefix rather than attached.

## Links

- Website: https://rstudio.github.io/rstudioapi/
- GitHub: https://github.com/rstudio/rstudioapi

## Problems it solves

- call RStudio IDE functions from my R package without breaking R CMD check
- open a file or get the current selection in RStudio from R code
- detect whether my R code is running inside RStudio

## Features

- calls the RStudio IDE API when it's available
- informative errors when it isn't
- safe to use from CRAN packages under R CMD check

## Trust

Overall: 0.36 out of 1.
Signals: maintenance 0.46, adoption 0.45, momentum 0.10, community 0.58, backing 0.30, extensibility 0.00.

- last commit 55 days ago
- 1 commits in the last 90 days
- latest release 0.19.0 5 months ago
- 175 GitHub stars
- 27 contributors
- backed by Posit

## Related

- Works with [RStudio](https://talira.ai/catalog/rstudio-1d5e9y7d.md)

## Sources

[^1]: https://github.com/rstudio/rstudioapi/blob/main/README.md (checked 28 Nov 2026)
[^2]: https://github.com/rstudio/rstudioapi/blob/main/DESCRIPTION (checked 28 Nov 2026)
