memoMDB: An MDB (Modeled DataBase) in memory: memoMDB

View source: R/memoMDB.R

memoMDBR Documentation

An MDB (Modeled DataBase) in memory: memoMDB

Description

An MDB (Modeled DataBase) in memory: memoMDB

Rename tables of a memoMDB object

Usage

memoMDB(
  dataTables,
  dataModel,
  dbInfo,
  collectionMembers = NULL,
  check = TRUE,
  checks = c("unique", "not nullable", "foreign keys"),
  verbose = FALSE
)

## S3 replacement method for class 'memoMDB'
names(x) <- value

## S3 method for class 'memoMDB'
rename(.data, ...)

## S3 method for class 'memoMDB'
x[i]

## S3 method for class 'memoMDB'
x[[i]]

## S3 method for class 'memoMDB'
x$i

Arguments

dataTables

a list of tibbles

dataModel

a ReDaMoR::RelDataModel object

dbInfo

a list with DB information: "name" (only mandatory field), "title", "description", "url", "version", "maintainer".

collectionMembers

the members of collections as provided to the collection_members<- function (default: NULL ==> no member).

check

logical: if TRUE (default) the data are confronted to the data model

checks

a character vector with the name of optional checks to be done (all of them c("unique", "not nullable", "foreign keys"))

verbose

if TRUE display the data confrontation report (default: FALSE)

x

a memoMDB object

value

new table names

.data

a memoMDB object

...

Use new_name = old_name to rename selected tables

i

the index or the name of the tables to take

Value

A memoMDB object

See Also

  • MDB methods: db_info, data_model, data_tables, collection_members, count_records, dims, filter_with_tables, as_fileMDB

  • Additional general documentation is related to MDB.

  • filter.memoMDB, slice.memoMDB

Examples

hpo <- read_fileMDB(
  path = system.file("examples/HPO-subset", package = "ReDaMoR"),
  dataModel = system.file("examples/HPO-model.json", package = "ReDaMoR"),
  dbInfo = list(
    "name" = "HPO",
    "title" = "Data extracted from the HPO database",
    "description" = paste(
      "This is a very small subset of the HPO!",
      "Visit the reference URL for more information"
    ),
    "url" = "http://human-phenotype-ontology.github.io/"
  )
) %>%
  as_memoMDB()
count_records(hpo)

## Too long on win-builder.r-project.org
if (FALSE) {
  hpoSlice <- slice(hpo, HPO_diseases = 1:10)
  count_records(hpoSlice)

  if ("stringr" %in% installed.packages()[, "Package"]) {
    epilHP <- filter(
      hpo,
      HPO_diseases = stringr::str_detect(
        label,
        stringr::regex("epilepsy", ignore_case = TRUE)
      )
    )
    count_records(epilHP)
  }
}

TKCat documentation built on Oct. 20, 2026, 9:07 a.m.