Getting started
Installation
The easiest way to get started with the redivis-r library is via a Redivis notebook, which comes with the latest version of this library pre-installed. Additionally, authentication is automatically handled within the Redivis notebook environment.
You can also install the latest release of this package in any other R environment from R-universe:
install.packages("redivis", repos = c(
"https://redivis.r-universe.dev",
"https://cloud.r-project.org"
))If on Linux, we recommended using pak to install prebuilt binaries from Posit Package Manager (PPM) and avoid long compilation times:
install.packages("pak")
pak::repo_add(CRAN = "PPM@latest", redivis = "https://redivis.r-universe.dev")
pak::pkg_install("redivis")Or, to install the development version directly from Github:
devtools::install_github("redivis/redivis-r", ref="main")Additionally, if you are working with geospatial data and want to use the to_sf_tibble() methods, you'll need to make sure that you have the sf package installed (instructions).
Example usage
library("redivis")
organization <- redivis$organization("demo")
dataset <- organization$dataset("cms_2014_medicare_data")
table <- dataset$table("home_health_agencies")
df <- table$to_tibble()When referencing datasets, workflows, and tables on Redivis, you should be familiar with the resource reference syntax.
Authentication
Within a Redivis notebook (automatic)
If you are using the redivis-r library within a notebook on Redivis, you'll automatically be authenticated and have access to any data within your workflow.
From another environment (OAuth)
If you are running the redivis-r library on another system (e.g., your laptop, Google Colab, or a shared compute cluster), you will be prompted to authenticate with your Redivis account the first time you run a command. Follow the printed instructions to authorize the R client to communicate with the Redivis API.
From a long-running service (API Token)
If you are developing a service that regularly interacts with Redivis without human intervention – for example, a recurring job that runs a data ingest pipeline – you can generate an API token to allow the service to act on your behalf.
This API token must then be set as the REDIVIS_API_TOKEN environment variable before running your R script. You can set the variable for your current session by running the following in your terminal:
Learn more
ReferenceExamplesLast updated
Was this helpful?

