Description Usage Arguments Value Examples
View source: R/database-functions.R
Writes Peak.list to an RSQLite database. Peak.list can be a tibble or data frame.
1 | write_tbl(mydf, peak.db, myname)
|
mydf |
tbl or dataframe to write |
peak.db |
Formal class SQLiteConnection |
myname |
character what should the table be called |
a tbl object in the remote source
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(LUMA)
if(require(RSQLite, quietly = TRUE)) {
file <- system.file("extdata","Sample_Data.csv", package = "LUMA") # is case sensitive on Linux
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) #Database is valid
dbListTables(peak_db) #But no tables yet
mydf <- Peaklist_Pos$From_CAMERA
write_tbl(mydf = mydf, myname = "From_CAMERA", peak.db = peak_db)
dbListTables(peak_db) #Now has tables
dbDisconnect(peak_db)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.