Learn R Programming

Opal R

Opal R Client for the Opal data warehouse. Most of the web services of Opal can be reached by an opalr function: import/export, data dictionaries, projects, tables, resources, permissions, users, DataSHIELD profiles etc.

See opalr documentation.

Installation:

# install from CRAN
install.packages("opalr")

# or install latest development version
remotes::install_github("obiba/opalr")

Basic usage:

library(opalr)
o <- opal.login('administrator', 'password', url = 'https://opal-demo.obiba.org')

# assign a table (as a data.frame) to a R symbol
opal.assign(o, 'D', 'CNSIM.CNSIM1')

# perform R operations on the server side
opal.execute(o, 'summary(D$GENDER)')
opal.execute(o, 'summary(D$LAB_GLUC)')

opal.logout(o)

Options

Some helper options can be defined to control default values and behavior:

  • opal.username, the login user name (default is NULL).
  • opal.password, the login user password (default is NULL).
  • opal.token, the login personal access token (default is NULL).
  • opal.url, the login Opal URL (default is NULL).
  • opal.opts, the curl options (default is NULL), see httr::httr_options.
  • opal.profile, the login profile (R servers cluster name) (default is NULL).
  • opal.progress, whether to show progress bar (default is TRUE).
  • opal.progress.clear, whether to clear progress bar after it is completed (default is FALSE).
  • opal.retry.times, the maximum number of GET requests to attempt (default is 3, no retry when value is 1).
  • opal.retry.quiet, whether to print a message displaying how long until the next request (default is FALSE).

Cookbooks

DataSHIELD Client

See the DSOpal documentation.

Copy Link

Version

Install

install.packages('opalr')

Monthly Downloads

1,235

Version

3.5.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Yannick Marcon

Last Published

November 16th, 2025

Functions in opalr (3.5.1)

.extractOpalCSRFToken

Extract CSRF token from cookie data frame.
.rmRSession

Remove a R session from Opal.
.extractLabel

Extract label for locale. If not found, fallback to undefined language label (if any).
.extractOpalSessionId

Extract opalsid from cookie data frame.
.isContentEmpty

Check if response content is empty.
.handleResponse

Default request response handler.
.getContent

Wrapper of httr::content()
.rmOpalSession

Remove a Opal session (logout)
.is.verbose

Verbose option
.handleError

Handle error response
dsadmin.install_github_package

Install a DataSHIELD package from GitHub
dsadmin.get_options

Get the DataSHIELD options
dsadmin.get_methods

Get DataSHIELD methods
dsadmin.install_local_package

Install a DataSHIELD package from a local archive file
.getSessions

Get all R session in Opal.
.url

Utility method to build urls. Concatenates all arguments and adds a '/' separator between each element
.getPEMFilePath

Extract absolute path to the pem file
.newProgress

Create a new progress instance with default settings.
.listToJson

Simple transformation function of a list into a JSON object/array.
.tokenHeader

Constructs the value for the X-Opal-Auth header
.handleResponseLocation

Default request response Location handler.
.verbose

Verbose flag
.opal.login

Create the opal object
.newSession

Create a new R session in Opal.
.select

Returns a list r such that r[[i]] == l[[i]][field] for all i:length(l)
.tickProgress

Output the progress status if option "datashield.progress" is allows to.
.handleResponseOrCallback

Process response with default handler or the provided one
dsadmin.perm_add

Add or update a DataSHIELD permission
dsadmin.log

Get DataSHIELD logs
dsadmin.install_package

Install a DataSHIELD package
dsadmin.profile

Get a DataSHIELD profile
dsadmin.profile_access

Restrict or open access to a DataSHIELD profile
dsadmin.installed_package

Check DataSHIELD package
dsadmin.package_description

Get DataSHIELD package description
dsadmin.perm_delete

Delete a DataSHIELD permission
dsadmin.activity_summary

Get DataSHIELD activity summary
dsadmin.get_method

Get a DataSHIELD method
dsadmin.activity

Get DataSHIELD activity
dsadmin.profile_init

Initialize a DataSHIELD profile
dsadmin.profile_create

Create a DataSHIELD profile
dsadmin.profile_rparser

Set or remove the R parser version of a DataSHIELD profile
dsadmin.profile_delete

Delete a DataSHIELD profile
dsadmin.profiles

Get DataSHIELD profiles
dsadmin.profile_perm

Get the permissions of a DataSHIELD profile
dsadmin.perm

Get the DataSHIELD permissions
dsadmin.package_descriptions

Get DataSHIELD package descriptions
dsadmin.rm_option

Remove a DataSHIELD option
dsadmin.rm_options

Remove all DataSHIELD options
dsadmin.rm_package_methods

Remove DataSHIELD package methods
dsadmin.publish_package

Publish DataSHIELD package settings
dsadmin.profile_perm_delete

Delete a permission from a DataSHIELD profile
dsadmin.rm_method

Remove DataSHIELD method
dsadmin.set_method

Set DataSHIELD method
dsadmin.remove_package

Remove DataSHIELD package
dsadmin.rm_methods

Remove DataSHIELD methods.
dsadmin.profile_exists

Check a DataSHIELD profile exists
dsadmin.profile_enable

Enable or disable a DataSHIELD profile
dsadmin.profile_perm_add

Add or update a permission on a DataSHIELD profile
dsadmin.set_package_methods

Set DataSHIELD package methods
dsadmin.set_option

Set DataSHIELD option
dsadmin.unpublish_package

Unpublish DataSHIELD package settings
oadmin.install_bioconductor_package

Install a package from Bioconductor
oadmin.activity_summary

Get R activity summary
oadmin.install_devtools

Install devtools package
oadmin.install_package

Install CRAN package
oadmin.install_cran_package

Install a package from CRAN
oadmin.installed_devtools

Check devtools package
oadmin.activity

Get R activity
oadmin.install_github_package

Install a package from GitHub
oadmin.install_local_package

Install a package from a local archive file
oadmin.installed_package

Check package is installed
oadmin.package_description

Get package description
oadmin.installed_packages

List installed packages
oadmin.log_sql

Get Opal SQL API logs
oadmin.perm_delete

Delete a R permission (deprecated)
oadmin.r_perm

Get the R permissions
oadmin.log

Get Opal main logs
oadmin.perm_add

Add or update a R permission (deprecated)
oadmin.log_rest

Get Opal REST API logs
oadmin.perm

Get the R permissions (deprecated)
oadmin.r_perm_delete

Delete a R permission
oadmin.system_perm

Get the System permissions
oadmin.user_delete

Delete a user
oadmin.system_metrics

Get system metrics
oadmin.user_enable

Enable a user
oadmin.user_add

Add a user
oadmin.remove_package

Remove package
oadmin.system_perm_add

Add or update a System permission
oadmin.system_perm_delete

Delete a System permission
oadmin.r_perm_add

Add or update a R permission
opal.assign.data

Data assignment
oadmin.user_profiles

Get user profiles
opal.assign

Data or expression assignment
oadmin.user_reset_password

Reset user password
oadmin.user_exists

Check user exists
opal.annotate

Apply the annotations to a Opal table
opal.annotations

Get the annotations of a Opal table
opal.as_md_table

Array to Markdown
oadmin.users

Get the users
oadmin.user_profile_delete

Delete a user profile
opal.assign.resource

Resource assignment
opal.assign.table

Data assignment to a data.frame
opal.command

Get an asynchronous command
opal.assign.table.tibble

Data assignment to a tibble
opal.command_result

Get result of an asynchronous command
opal.assign.script

R script assignment
opal.command_rm

Remove an asynchronous command
opal.attribute_values

Get a vector of attribute values
opal.commands

List the asynchronous commands
opal.commands_rm

Remove all asynchronous commands
opal.file

Get file content
opal.datasource

Get a datasource
opal.file_download

Download a file
opal.file_mkdir

Make a folder
opal.file_ls

List content of a folder
opal.file_cp

Copy a file
opal.execute.source

Execute a R file script
opal.execute

Execute a R script
opal.delete

Generic REST resource deletion.
opal.datasources

Get datasources
opal.load_package

Load package
opal.file_write

Write a file
opal.login

Opal login
opal.file_read

Read a file
opal.file_rm

Remove a file
opal.get

Generic REST resource getter.
opal.file_mkdir_tmp

Make a temporary folder
opal.file_mv

Move and/or rename a file
opal.file_upload

Upload a file or a folder
opal.file_unzip

Unzip a zip archive file
opal.project_command

Get project task
opal.project_create

Create a project
opal.project_backup

Backup a project
opal.project

Get a project
opal.perms

Get the permissions of a subject
opal.logout

Logout from Opal(s)
opal.profiles

List R profiles
opal.post

Generic REST resource creation.
opal.project_perm_delete

Delete a permission from a project
opal.project_restore

Restore a project
opal.project_perm

Get the permissions on a project
opal.projects_databases

Get projects databases
opal.project_perm_add

Add or update a permission on a project
opal.projects

Get projects
opal.resource

Get a resource reference of a project
opal.project_delete

Delete a project
opal.report_md

Turn a R markdown file to html.
opal.project_exists

Check a project exists
opal.report

Opal report
opal.put

Generic REST resource update.
opal.resource_view_create

Create an Opal view over a resource reference
opal.resource_extension_create

Create an extended resource reference in a project
opal.resource_perm_add

Add or update a permission on a resource
opal.resource_create

Create a resource reference in a project
opal.resource_view_reconnect

Reconnect an Opal view to its underlying resource
opal.resource_perm_delete

Delete a permission from a resource
opal.resource_delete

Delete a resource reference
opal.resource_perm

Get the permissions on a resource
opal.resource_exists

Check a resource reference exists
opal.resource_get

Get the resource object of a project
opal.session_events

Get the events associated to the R session
opal.resources

Get the resource references of a project
opal.session_delete

Delete the R session
opal.rm

Remove a R symbol (deprecated)
opal.resources_perm

Get the permissions on any resource
opal.session_get

Get the R session
opal.session_exists

Check if the R session exists
opal.session

Create the R session
opal.resources_perm_delete

Delete a permission from any resource
opal.resources_perm_add

Add or update a permission on any resource
opal.symbol_import

Import a tibble
opal.table

Get a table of a datasource
opal.table_delete

Delete a Opal table
opal.sql_history

SQL query execution history
opal.symbol_rm

Remove a R symbol
opal.table_create

Create an Opal table or view
opal.symbols

List R symbols
opal.symbol_save

Save a tibble
opal.sql

Execute a SQL query on tables
opal.session_running

Check if the R session is running
opal.table_perm_delete

Delete a permission from a table
opal.table_export

Export a table as a file
opal.table_save

Save a local tibble as a Opal table
opal.table_perm

Get the permissions on a table
opal.table_dictionary_update

Update the dictionary of a Opal table
opal.table_dictionary_get

Get the dictionary of a Opal table
opal.table_exists

Check a Opal table exists
opal.table_perm_add

Add or update a permission on a table
opal.table_get

Get a Opal table as a tibble
opal.table_import

Import a file as table
opal.task

Get a task
opal.table_truncate

Truncate a Opal table
opal.tables_perm_delete

Delete a permission from any table of a project
opal.table_view_update

Update the table references and the entity filter of an Opal view
opal.tables

Get tables of a datasource
opal.tables_perm

Get the permissions on any table of a project
opal.tables_perm_add

Add or update a permission on any table of a project
opal.task_wait

Wait for a task to complete.
opal.task_cancel

Cancel a task
opal.table_view_create

Create an Opal view over tables
opal.terms

Get the terms of a vocabulary
opal.token_datashield_create

Create a personal access token for Datashield usage
opal.taxonomies

Get taxonomies
opal.taxonomy_download

Download a taxonomy file
opal.token

Get a personal access token
opal.taxonomy_upload

Upload a taxonomy file
opal.taxonomy_delete

Delete a taxonomy
opal.taxonomy

Get a taxonomy
opal.tasks

Get the tasks
opal.variables

Get variables of a table
opal.token_delete

Delete a personal access token
opal.tokens

Get the personal access tokens
opal.unload_package

Unload package
opal.token_sql_create

Create a personal access token for SQL usage
opal.variable

Get a variable of a table
opal.version_compare

Compare
opal.variable_summary

Get summary statistics of a variable of a table
opal.token_renew

Renew an inactive personal access token
opal.token_r_create

Create a personal access token for R usage
opal.valueset

Get the values of an entity
opal.workspace_save

Save the current session in a opal R workspace.
opalr-package

opalr: 'Opal' Data Repository Client and 'DataSHIELD' Utils
opal.workspaces

Get the R workspaces from a opal.
opal.vocabularies

Get the vocabularies of a taxonomy
opal.vocabulary

Get a taxonomy vocabulary
opal.workspace_restore

Restore a R workspace from a opal.
opal.workspace_rm

Remove a R workspace from a opal.
.authorizationHeader

Constructs the value for the Authorization header
dictionary.annotations

List the annotations
dictionary.inspect

Inspect the dictionary of a tibble
dictionary.apply

Apply the dictionary to a tibble
dictionary.annotate.harmo_status

Set variable annotation with Harmonization Status term
dictionary.annotate

Set variable annotation with a taxonomy term
.as.zeroOne

Turns a value into 0/1 numeric.
.deparse

Turn expression into character strings.
.aclsToDataFrame

Permsissions (ACLs) into a data frame.
.extractJsonField

Extract JSON