opal.table_import: Import a file as table

Description Usage Arguments See Also Examples

View source: R/opal.table.R

Description

Import a file as a table in Opal. The file formats supported are: RDS (.rds), SPSS (.sav), SPSS compressed (.zsav), SAS (.sas7bdat), SAS Transport (.xpt), Stata (.dta). The RDS format is a serialized single R object (expected to be of tibble class), that can be obtained using base::saveRDS(). The other file formats are the ones supported by the haven R package. This operation creates an importation task in Opal that can be followed (see tasks related functions).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
opal.table_import(
  opal,
  file,
  project,
  table,
  identifiers = NULL,
  policy = "required",
  id.name = "id",
  type = "Participant",
  wait = TRUE
)

Arguments

opal

Opal object.

file

Path in Opal to the file that will be read as a tibble.

project

Name of the project into which the data are to be imported.

table

Destination table name.

identifiers

Name of the identifiers mapping to use when assigning entities to Opal.

policy

Identifiers policy: 'required' (each identifiers must be mapped prior importation (default)), 'ignore' (ignore unknown identifiers) and 'generate' (generate a system identifier for each unknown identifier).

id.name

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

type

Entity type (what the data are about). Default is 'Participant'.

wait

Wait for import task completion. Default is TRUE.

See Also

Other table functions: opal.table_create(), opal.table_delete(), opal.table_dictionary_get(), opal.table_dictionary_update(), opal.table_exists(), opal.table_export(), opal.table_get(), opal.table_perm_add(), opal.table_perm_delete(), opal.table_perm(), opal.table_save(), opal.table_truncate()

Examples

1
2
3
4
5
6
## Not run: 
o <- opal.login('administrator','password', url='https://opal-demo.obiba.org')
opal.table_import(o, '/home/administrator/mydataset.rds', 'test', 'mytable')
opal.logout(o)

## End(Not run)

opalr documentation built on Oct. 26, 2021, 5:06 p.m.