Learn R Programming

opalr (version 3.3.1)

opal.table_export: Export a table as a file

Description

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.

Usage

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.

See Also

Other table functions: opal.resource_view_create(), opal.resource_view_reconnect(), opal.table_create(), opal.table_delete(), opal.table_dictionary_get(), opal.table_dictionary_update(), opal.table_exists(), opal.table_get(), opal.table_import(), opal.table_perm_add(), opal.table_perm_delete(), opal.table_perm(), opal.table_save(), opal.table_truncate(), opal.table_view_create(), opal.table_view_update()

Examples

Run this code
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)
}

Run the code above in your browser using DataLab