Skip to main content

R Compatible results

  1. Load the corresponding samples in Result.
  2. If required, perform data normalization.
  3. Export the results as comma separated value (.csv).

The first rows of the exported file (.csv) are analyte-related meta information. The first columns (from the left) contain sample-related meta information.

To load a .csv export file in R, the following script may be used:

# load the complete exported .csv file
allData <- read.csv("export.csv", sep = ";", na.strings = c("", "NA"), skip = 1,
stringsAsFactors = FALSE)

# get the number of metadata attributes for analytes and samples
mtdtRows <- which(!is.na(allData[,1]))[1]-1
mtdtCols <- which(!is.na(allData[1,]))[1]

# extract the values
data <- allData[(mtdtRows+1):nrow(allData), (mtdtCols+1):ncol(allData)]

# extract sample metadata
obsMtdt <- allData[(mtdtRows+1):nrow(allData), 1:mtdtCols]

# extract analyte metadata
analyteMtdt <- allData[1:mtdtRows, (mtdtCols+1):ncol(allData)]
analyteMtdt <- as.data.frame(t(analyteMtdt), stringsAsFactors = FALSE)
colnames(analyteMtdt) <- allData[1:mtdtRows, mtdtCols]

The script loads the data and stores it in three separated data frames:

  • analyte-related meta information
  • sample-related meta information
  • results (concentration data)