Skip to contents

Read a data file, select columns necessary for analysis, and return the reformatted data.

Usage

preprocess(
  fileName,
  dataSet = NULL,
  attrnames = c("gender", "treatment", "replicate"),
  zeroNA = TRUE
)

Arguments

fileName

The name of the .csv file containing metabolomics data (including the path to the file, if needed).

dataSet

The raw data set, if already loaded in R.

attrnames

A vector of strings (default = c("gender", "treatment", "replicate")) specifying the names of the attribute columns.

zeroNA

A boolean (default = TRUE) specifying whether 0's should be converted to NA's.

Value

A 2d dataframe.

Details

The function executes the following:

  1. Reads the file.

  2. Provides summary statistics and a histogram of all values reported in the data set.

  3. Re-formats the data to present individual compounds as columns.

  4. Stores the data as a data.frame and prints the levels of attributes to the user.