Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Safely access RStudio's API (when available)

License

NotificationsYou must be signed in to change notification settings

rstudio/rstudioapi

Repository files navigation

CRAN statusCodecov test coverageR-CMD-check

Therstudioapi package is designed to make it easy to conditionallyaccess theRStudio API from CRAN packages, avoidingany potential problems withR CMD check. This package contains ahandful of useful wrapper functions to access the API. To see thefunctions that are currently available in the API, runhelp(package = "rstudioapi")

Installation

You can install the released version ofrstudioapi fromCRAN with:

install.packages("rstudioapi")

And the development version fromGitHub with:

# install.packages("devtools")devtools::install_github("rstudio/rstudioapi")

Example

Therstudioapi package is designed to never be attached to your searchpath. Always prefix function calls withrstudioapi::.

# Returns T/Frstudioapi::isAvailable()# Returns error if not availablerstudioapi::verifyAvailable()# Optional argument allows you to specify version requirementrstudioapi::isAvailable("0.99")rstudioapi::verifyAvailable("0.99")# Call an rstudio functionrstudioapi::callFun("viewer","http://localhost:8080")# This will raise an error if rstudio is not running, or the function# is not found. To run a different function if it's not available,# use existsif (rstudioapi::hasFun("viewer")) {rstudioapi::callFun("viewer","http://localhost:8080")}else {  browseURL("http://localhost:8080")}# You can use find to get the function. Throws an error if the function# does not exist.rstudioapi::findFun("viewer")# You can also check version in exists and findrstudioapi::findFun("viewer",0.99)rstudioapi::hasFun("viewer",0.99)

About

Safely access RStudio's API (when available)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp