Reference
The redivis R package provides an interface to construct representations of Redivis entities and to create, modify, read, and delete them.
Resources are generally constructed by chaining together multiple constructor methods, reflecting the hierarchical nature of entities in Redivis. For example, to list all variables on table (which belongs to a dataset in an organization), we would write:
library("redivis")
variables = (
redivis$organization("Demo") # Returns an instance of an Organization
$dataset("CMS 2014 Medicare Data" # Returns an instance of a Dataset
$table("Home health agencies") # Returns an instance of a Table
$list_variables() # Retuns a list of Variable instances
)Interfaces
The redivis namespace. Provides constructor methods for most of the other classes.
Class representing a Redivis dataset. Provides constructor methods for Tables and Queries scoped to a given dataset, as well as methods for creating, deleting, and updating datasets.
Class representing a non-tabular file on Redivis.
Class representing a Redivis organization. Provides constructor methods for Datasets and Workflows scoped to a given organization.
Class representing a Redivis workflow. Provides constructor methods for Tables and Queries scoped to a given workflow.
Class representing a running SQL query that references tables on Redivis.
Class representing a Redivis table. Numerous methods available for reading data from the table, as well as uploading data and metadata.
Class representing a Redivis user. Provides constructor methods for Datasets and Workflows scoped to a given user.
Class representing a specific variable with a Table.
Environment variables
The following environment variables may be set to modify the behavior of the redivis-r client. Except for REDIVIS_API_TOKEN, each can also be set at runtime via redivis$config(), which takes precedence over the environment variable. Arguments passed directly to a method (e.g., progress = FALSE) take precedence over both.
Environment variable
redivis$config() argument
Default
REDIVIS_API_TOKEN
—
REDIVIS_DEFAULT_WORKFLOW
default_workflow
REDIVIS_DEFAULT_DATASET
default_dataset
REDIVIS_DEFAULT_USER
default_user
REDIVIS_DEFAULT_ORGANIZATION
default_organization
REDIVIS_API_ENDPOINT
api_endpoint
https://redivis.com/api/v1
REDIVIS_CONFIG_DIR
config_dir
~/.redivis
REDIVIS_TMP_DIR
tmp_dir
tempdir()
REDIVIS_MAX_PARALLELIZATION
max_parallelization
Varies by method
REDIVIS_PROGRESS
progress
TRUE
REDIVIS_API_TOKEN
If using this library in an external environment, you'll need set this env variable to your API token in order to authenticate.
REDIVIS_DEFAULT_WORKFLOW
If set, tables referenced via redivis$table() and unqualified table names in redivis$query() will be assumed to be within the default workflow.
Takes the form user_name.workflow_name. All notebooks on Redivis automatically set the default workflow to that notebook's workflow. Learn more about referencing resource >
REDIVIS_DEFAULT_DATASET
If set, tables referenced via redivis$table() and unqualified table names in redivis$query() will be assumed to be within the default dataset.
Takes the form owner_name.dataset_name. If both a default dataset and workflow are set, the default workflow will supersede the dataset. Learn more about referencing resource >
REDIVIS_DEFAULT_USER
If set, datasets and workflows referenced via redivis$dataset() and redivis$workflow() without an owner (e.g., redivis$dataset("my_dataset")) will be assumed to belong to this user.
REDIVIS_DEFAULT_ORGANIZATION
If set, datasets and workflows referenced without an owner will be assumed to belong to this organization. If both a default user and organization are set, the default user will supersede the organization.
REDIVIS_API_ENDPOINT
The base URL of the Redivis API. Defaults to https://redivis.com/api/v1.
REDIVIS_CONFIG_DIR
The directory in which credentials are cached after logging in. Defaults to ~/.redivis. Credentials for redivis.com are cached directly in this directory, and those for any other API endpoint in a subdirectory for its host (e.g., environments/localhost_8080/), so that logging in to another environment never replaces your credentials for redivis.com.
REDIVIS_TMP_DIR
If set, this directory will be used to temporarily store data for disk-backed data objects (e.g., see Table$to_arrow_dataset). Otherwise, tempdir() will be used.
REDIVIS_MAX_PARALLELIZATION
The default for the max_parallelization argument of methods that read, download, or upload data in parallel, such as table$to_tibble(), table$download_files(), and table$add_files(). When not set, each method uses its own default, based on the number of available CPUs.
REDIVIS_PROGRESS
The default for the progress argument, which shows progress bars for long-running operations. Set to false (or 0) to hide progress bars by default. Defaults to TRUE.
Last updated
Was this helpful?

