Skip to contents

This function connects to a database and returns a connection object. Currently, it supports the following databases: "chembl", "eup", and "foodb".

Usage

db_connect(db, version = "latest", ...)

Arguments

db

character; database name. Must be one of "chembl", "eup", or "foodb".

version

character; version of the database. Either "latest" (default) or a specific version number, e.g. "30". Only applicable for "chembl".

...

Further args passed on to [DBI::dbConnect()]

Value

an object of class "SQLiteConnection".

Examples

if (FALSE) { # \dontrun{
# Connect to the latest version of the ChEMBL database
con <- db_connect("chembl", version = "latest")
# Connect to the EU Pesticides database
con <- db_connect("eup")
# Connect to the FooDB database
con <- db_connect("foodb")
} # }