Description Usage Arguments Value Examples
View source: R/wrapper-functions.R
Write xlsx table output from plot_metgroup
. Essentially
a wrapper for openxlsx::saveWorkbook
1 | write_xlsx(validate.sheets, file.base, myname, mysheets)
|
validate.sheets |
list of sheets to write to xlsx file. Currently must be of length 2 |
file.base |
character return from |
myname |
character string to append to file.base to name xlsx file |
mysheets |
character vector to name sheets in xlsx file. Currently must
be of length 2. Default is |
Workbook
from the openxlsx
package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | library(LUMA)
if(require(lcmsfishdata, quietly = TRUE)) {
# is case sensitive on Linux
file <- system.file("extdata","Sample_Class.txt", package = "lcmsfishdata")
Sample.df <- read.table(file, header = TRUE, sep = "\t")
file2 <- system.file("extdata","CAMERA_objects_Pos.Rdata", package =
"lcmsfishdata") # is case sensitive on Linux
load(file2, envir = environment())
Peak.list <- lcmsfishdata::Peaklist_Pos[["input_parsed"]]
# is case sensitive on Linux
file3 <- system.file("extdata","Sample_Data.csv", package = "lcmsfishdata")
sample_data <- read.table(file3, header = TRUE, sep = ",")
mzdatafiles <- sample_data$CT.ID
file.base <- gen_filebase(mzdatafiles = mzdatafiles, BLANK = FALSE, IonMode
= "Positive", ion.id = c("Pos","Neg"))
mylist <- plot_metgroup(CAMERA.obj = anposGa, Sample.df = Sample.df,
Peak.list = Peak.list, center = 2, BLANK = FALSE, gen.plots = FALSE,
IonMode = "Positive", file.base = file.base, QC.id = "Pooled_QC", maxlabel
= 10)
class(mylist) ##is list
length(mylist) ## with 2 elements
validate.sheets <- mylist[[2]]
myname <- "Validate_Metabolite_Groups"
test <- write_xlsx(validate.sheets = validate.sheets, file.base = file.base, myname = myname)
class(test) #returns Workbook object from the openxlsx package
file.remove(paste(file.base, paste(myname,".xlsx", sep = ""), sep = "_"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.