- Notifications
You must be signed in to change notification settings - Fork36
Safely access RStudio's API (when available)
License
rstudio/rstudioapi
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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")
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")
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
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
