opalr (version 1.4.1)

harmo.table_save: Save a local tibble as a Opal table

Description

Upload a local tibble to the R server side through Opal, assign this tibble to the provided symbol name and import it as a table into a Opal project.

Usage

harmo.table_save(
  opal,
  tibble,
  project,
  table,
  overwrite = TRUE,
  force = FALSE,
  identifiers = NULL,
  policy = "required",
  id.name = "id",
  type = "Participant"
)

Arguments

opal

Opal connection object.

tibble

The tibble object to be imported.

project

Project name where the table will be located.

table

Destination table name.

overwrite

If the destination table already exists, it will be replaced (deleted and then imported). Otherwise the table will be updated (data dictionaries merge may conflict). Default is TRUE.

force

If the destination already exists, stop with an informative message if this flag is FALSE (default).

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'

Value

An invisible logical indicating whether the destination table exists.

Examples

Run this code
# NOT RUN {
o <- opal.login('administrator','password','https://opal-demo.obiba.org')
cqx <- harmo.table_get(o, "CPTP", "Cag_coreqx")
# do some (meta)data transformations, then save in opal's database
harmo.table_save(o, cqx, "CPTP", "Cag_coreqx", overwrite = TRUE, force = TRUE)
opal.logout(o)
# }

Run the code above in your browser using DataCamp Workspace