import_pvals {ezECM}R Documentation

Import p-values

Description

Imports and organizes observed p-values located in a ⁠*.csv⁠ file for training or categorization using an existing model.

Usage

import_pvals(file = NULL, header = TRUE, sep = ",", training = TRUE)

Arguments

file

Character string providing name of ⁠*.csv⁠ file to be imported. File name within current working directory or absolute path are acceptable. Argument passed directly to utils::read.csv(), see utils::read.csv() for details.

header

Logical indicating if first row of supplied ⁠*.csv⁠ file contains column names. See utils::read.csv() for details.

sep

Character string indicating the field separator character for the supplied ⁠*.csv⁠ file.

training

Logical indicating if the supplied ⁠*.csv⁠ file is to be used as training data. Only serves to suppress warnings.

Details

The purpose of this function is to give the user a way to import p-value data in which the data will be organized for use with the cECM() and BayesECM() functions. Warnings are printed when potential issues may arise with the supplied file, and the function attempts to detect and correct simple formatting issues.

Ideally, the user supplies a ⁠*.csv⁠ file which contains a header row labeling the columns. Each column contains the p-values of a particular discriminant, and each row must correspond to a single event. If training data is to be imported, the column containing known event categories is labeled "event". If new data is imported to be used with an existing model fit, the order of the columns in the new.data file must be the same as the ⁠*.csv⁠ file containing training data.

Value

A base::data.frame() of p-values with each row corresponding to a single event and each column corresponding to a particular discriminant. If data labels are correctly provided in the supplied ⁠*.csv⁠ file, an additional column labeled event will hold these values.

Examples


file_path <- system.file("extdata", "good_training.csv", package = "ezECM")
training_data <- import_pvals(file = file_path, header = TRUE, sep = ",", training = TRUE)


[Package ezECM version 1.0.0 Index]