createSELFile: Creates an SEL formatted file

View source: R/sel.R

createSELFileR Documentation

Creates an SEL formatted file

Description

Given data structures that represent the various pieces of an SEL file, this function will write or return SEL formatted files

Usage

createSELFile(selExperimentMetaData, selCalculatedResults = NULL,
  selRawResults = NULL, outputFilePath = NULL, format = "CSV")

Arguments

selExperimentMetaData

typically a data.frame created by createSELExperimentMetaData

selCalculatedResults

optional data.frame of the format createSELCalculatedResults

selRawResults

optional data.frame of the format createSELRawResults

outputFilePath

optional output file path (see details for return if left NULL)

format

"CSV", "XLS" or "XLSX" (not used if outputFilePath is NULL, see details)

Details

If the outputFilePath is NULL then the function will write the CSV representation of the file to a character and return, otherwise it returns the path to the written file.

Value

character path of the written file or character of the CSV results

Examples

selExperimentMetaData <- createSELExperimentMetaData(protocolName = "Cytotox Assay",
                                                experimentName = "2013123_cytotox_bbolt",
                                                assayDate = "2013-01-12")

cars2 <- cars
cars2$Sample <- paste0("CORP",1:nrow(cars))
selCalculatedResults <- createSELCalculatedResults(cars2, corporateIDColumn = "Sample")

#Outputs a character representation of a CSV SEL format
createSELFile(selExperimentMetaData, selCalculatedResults)

#Outputs a file in SEL format
myFile <- tempfile()
createSELFile(selExperimentMetaData, selCalculatedResults, outputFilePath = myFile)
read.csv(myFile)

mcneilco/racas documentation built on April 19, 2024, 1:12 p.m.