Export a table as file in the specified format. The file destination is in the Opal server file system. See opal.file_download to download the file locally. See also opal.table_get to get directly the table as an R object.

opal.table_export(
  opal,
  project,
  table,
  file,
  identifiers = NULL,
  id.name = "id",
  wait = TRUE
)

Arguments

opal

Opal connection object.

project

Project name where the table is located.

table

Table name to export.

file

Destination file in the Opal file system. The expected file extensions are: rds (RDS), sav (SPSS), zsav (SPSS compressed), sas7bdat (SAS), xpt (SAS Transport), dta (Stata).RDS (serialized single R object) is to be read by base::readRDS(), while other formats are supported by the haven R package.

identifiers

Name of the identifiers mapping to use when exporting entities from Opal.

id.name

The name of the column representing the entity identifiers. Default is 'id'.

wait

Wait for import task completion. Default is TRUE.

Examples

if (FALSE) {
o <- opal.login('administrator','password', url='https://opal-demo.obiba.org')
cqx <- opal.table_export(o, "CNSIM", "CNSIM1", 
                         file = "/home/administrator/cnsim1.sav")
opal.logout(o)
}