{"id":14069071,"url":"https://github.com/rstudio/rstudioapi","last_synced_at":"2025-05-14T15:11:13.970Z","repository":{"id":47460851,"uuid":"15796593","full_name":"rstudio/rstudioapi","owner":"rstudio","description":"Safely access RStudio's API (when available)","archived":false,"fork":false,"pushed_at":"2024-11-04T18:45:37.000Z","size":1127,"stargazers_count":173,"open_issues_count":136,"forks_count":37,"subscribers_count":55,"default_branch":"main","last_synced_at":"2025-05-03T01:12:29.130Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rstudio.github.io/rstudioapi","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rstudio.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-10T11:37:40.000Z","updated_at":"2025-04-12T18:21:29.000Z","dependencies_parsed_at":"2022-08-26T16:52:16.889Z","dependency_job_id":"8d95ab47-1b5a-4a4c-9ea9-9b5f5b8f5e44","html_url":"https://github.com/rstudio/rstudioapi","commit_stats":{"total_commits":338,"total_committers":28,"mean_commits":"12.071428571428571","dds":0.5502958579881656,"last_synced_commit":"a98549272c1b7a782e7578306b824f785410ff7a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Frstudioapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Frstudioapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Frstudioapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Frstudioapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rstudio","download_url":"https://codeload.github.com/rstudio/rstudioapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254042311,"owners_count":22004898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:06:35.214Z","updated_at":"2025-05-14T15:11:13.911Z","avatar_url":"https://github.com/rstudio.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# rstudioapi \u003ca href='https://rstudio.github.io/rstudioapi/'\u003e\u003cimg src='man/figures/logo.png' align=\"right\" height=\"139\" /\u003e\u003c/a\u003e\n\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/rstudioapi)](https://CRAN.R-project.org/package=rstudioapi)\n[![Codecov test coverage](https://codecov.io/gh/rstudio/rstudioapi/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rstudio/rstudioapi?branch=main)\n[![R-CMD-check](https://github.com/rstudio/rstudioapi/workflows/R-CMD-check/badge.svg)](https://github.com/rstudio/rstudioapi/actions)\n\u003c!-- badges: end --\u003e\n\nThe `rstudioapi` package is designed to make it easy to conditionally access the\n[RStudio](https://posit.co/) API from CRAN packages, avoiding any\npotential problems with `R CMD check`. This package contains a handful of useful\nwrapper functions to access the API. To see the functions that are currently\navailable in the API, run `help(package = \"rstudioapi\")`\n\n\n## Installation\n\nYou can install the released version of `rstudioapi` from [CRAN](https://CRAN.R-project.org) with:\n\n``` r\ninstall.packages(\"rstudioapi\")\n```\n\nAnd the development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"rstudio/rstudioapi\")\n```\n\n## Example\n\nThe `rstudioapi` package is designed to never be attached to your search path.\nAlways prefix function calls with `rstudioapi::`.\n\n```R\n\n# Returns T/F\nrstudioapi::isAvailable()\n# Returns error if not available\nrstudioapi::verifyAvailable()\n\n# Optional argument allows you to specify version requirement\nrstudioapi::isAvailable(\"0.99\")\nrstudioapi::verifyAvailable(\"0.99\")\n\n# Call an rstudio function\nrstudioapi::callFun(\"viewer\", \"http://localhost:8080\")\n\n# This will raise an error if rstudio is not running, or the function\n# is not found. To run a different function if it's not available,\n# use exists\nif (rstudioapi::hasFun(\"viewer\")) {\n  rstudioapi::callFun(\"viewer\", \"http://localhost:8080\")\n} else {\n  browseURL(\"http://localhost:8080\")\n}\n\n# You can use find to get the function. Throws an error if the function\n# does not exist.\nrstudioapi::findFun(\"viewer\")\n\n# You can also check version in exists and find\nrstudioapi::findFun(\"viewer\", 0.99)\nrstudioapi::hasFun(\"viewer\", 0.99)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio%2Frstudioapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frstudio%2Frstudioapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio%2Frstudioapi/lists"}