data_dict_opalr_fix: Transform a data dictionary object from 'opalr' format to...

data_dict_opalr_fixR Documentation

Transform a data dictionary object from 'opalr' format to Opal format

Description

Transforms a data dictionary from 'opalr' format to Opal format. A data dictionary imported using the 'opalr' package has a different structure and will be transformed to the structure used in Maelstrom packages.

Usage

data_dict_opalr_fix(data_dict)

Arguments

data_dict

A list of tibble(s) representing meta data to be transformed. Automatically generated if not provided.

Details

Opal is the OBiBa application for data management, and Opal environments can be integrated with RStudio environments using the package opalr. The user must have adequate credentials to interact with a specific Opal environment. Some function errors produced may be associated with the handler or Opal read/write permissions.

Value

A list of tibble(s) identifying a data dictionary.

See Also

Please see Opal documentation for complete documentation. madshapR::as_data_dict_mlstr()

Examples

## Not run: 

library(opalr)
opal <- 
 opal.login('administrator','password',
   url ='https://opal-demo.obiba.org/')
   
# use DEMO_files provided by the package
library(madshapR)
library(stringr)

dossier <-
  DEMO_files[str_detect(names(DEMO_files),"dataset_MELBOURNE")]

tempdir <- basename(tempdir())
try(opal_project_create(opal, tempdir))

try(
  opal_tables_push(
  opal, dossier,project_name = tempdir, .force = TRUE, .overwrite = TRUE))

# get the data dictionary and reshape it.
 data_dict <-
   try(
   opal.table_dictionary_get(
   opal,project = tempdir,table = "dataset_MELBOURNE_1"))

 data_dict <- try(data_dict_opalr_fix(data_dict))
  

## End(Not run)


mlstrOpalr documentation built on Oct. 11, 2023, 5:15 p.m.