read_from_excel: Read formatted Excel files

Description Usage Arguments Details Value

View source: R/class_constructor.R

Description

Reads data from an Excel file of the following format:

See the vignette for more information. This function separates the three parts from the file, and returns them in a list

Usage

1
2
3
read_from_excel(file, sheet = 1, corner_row = NULL,
  corner_column = NULL, id_prefix = "ID_", split_by = NULL,
  name = NULL)

Arguments

file

path to the Excel file

sheet

the sheet number or name

corner_row

integer, the bottom row of sample information, usually contains data file names and feature info column names. If set to NULL, will be detected automatically.

corner_column

integer or character, the corresponding column number or the column name (letter) in Excel. If set to NULL, will be detected automatically.

id_prefix

character, prefix for autogenerated sample IDs, see Details

split_by

character vector, in the case where all the modes are in the same Excel file, the column names of feature data used to separate the modes (usually Mode and Column)

name

in the case where the Excel file only contains one mode, the name of the mode, such as "Hilic_neg"

Details

Only specify one of split_by and name. The feature data returned will contain a column named "Split", which is used to separate features from different modes. Unless a column named "Feature_ID" is found in the file, a feature ID will be generated based on the value of "Split", mass and retention time. The function will try to find columns for mass and retention time by looking at a few common alternatives, and throw an error if no matching column is found. Sample information needs to contain a row called "Injection_order", and the values need to be unique. In addition, a possible sample identifier row needs to be named "Sample_ID", and the values need to be unique, with an exception of QC samples: if there are any "QC" identifiers, they will be replaced with "QC_1", "QC_2" and so on. If a "Sample_ID" row is not found, it will be created using the id_prefix and injection order.

Value

list of three data frames:


antonvsdata/amp documentation built on Jan. 8, 2020, 3:15 a.m.