memoMDB {TKCat}R 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

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
## Not run: 
   
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)
}


## End(Not run)

[Package TKCat version 1.1.7 Index]