Learn R Programming

opalr (version 3.3.1)

dictionary.annotate: Set variable annotation with a taxonomy term

Description

Apply or remove an annotation from a set of variables.

Usage

dictionary.annotate(
  tibble,
  variables = NULL,
  taxonomy = "Mlstr_area",
  vocabulary,
  term
)

Value

The annotated tibble

Arguments

tibble

Tibble to be annotated.

variables

A character vector of variable names to be annotated. If NULL or empty, all the columns of the tibble will be annotated.

taxonomy

The taxonomy to which the vocabulary belongs. If NULL, the annotation is a simple attribute (i.e. without a taxonomy reference).

vocabulary

The vocabulary to which the term belongs.

term

The term to apply. If NULL, the annotation will be deleted.

Examples

Run this code
if (FALSE) {
o <- opal.login('administrator','password', url='https://opal-demo.obiba.org')
cqx <- opal.table_get(o, "CPTP", "Cag_coreqx")
cqx <- dictionary.annotate(cqx, 
  variables = c("A_SDC_EDU_LEVEL", "A_SDC_EDU_LEVEL_AGE"), 
  taxonomy = "Mlstr_area", 
  vocabulary = "Sociodemographic_economic_characteristics", 
  term = "Education")
opal.logout(o)
}

Run the code above in your browser using DataLab