extract_database_name: Extract the Name of the Database

View source: R/6_zzz.R

extract_database_nameR Documentation

Extract the Name of the Database

Description

This function extracts and formats the name of a database from a 'databaseClass' object by combining the source and version information.

Usage

extract_database_name(database)

Arguments

database

A 'databaseClass' object containing database information.

Details

The function extracts the 'Source' and 'Version' fields from the 'database.info' slot of the 'databaseClass' object and combines them using an underscore ('_'). This formatted string represents the name of the database.

Value

A character string representing the name of the database, formatted as 'Source_Version'. Returns 'NULL' if the input is not a 'databaseClass' object.

Examples

## Not run: 
# Load a sample database
my_database <- load_database("path/to/database")

# Extract the name of the database
db_name <- extract_database_name(my_database)
print(db_name)  # Output might be "HMDB_4.0"

## End(Not run)



tidymass/metid documentation built on Oct. 8, 2024, 10:32 p.m.