connect_peakdb: Connects to peak database

Description Usage Arguments Value Examples

View source: R/database-functions.R

Description

Establishes a connection to an SQLite database for storing Peak.list; if doesn't exist, creates new database

Usage

1
connect_peakdb(file.base, db.dir, mem)

Arguments

file.base

character return from gen_filebase function

db.dir

character what should the database directory be called. Default is "db".

mem

logical should database be in-memory. Default is FALSE.

Value

Formal class SQLiteConnection

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(LUMA)
if(require(RSQLite, quietly = TRUE)) {
# is case sensitive on Linux
file <- system.file('extdata','Sample_Data.csv', package =  "LUMA")
sample_data <- read.table(file, header = TRUE, sep = ",")
mzdatafiles <- sample_data$CT.ID
file.base <- gen_filebase(mzdatafiles = mzdatafiles, BLANK = FALSE, IonMode =
"Positive", ion.id = c("Pos","Neg")) #Returns "Peaklist_Pos"
peak_db <- connect_peakdb(file.base = file.base, mem = TRUE)
dbIsValid(peak_db) #valid database is created
dbDisconnect(peak_db)
}

USEPA/LUMA documentation built on Aug. 29, 2020, 1:40 p.m.