checkReferenceFile: Check a reference profiles file

View source: R/checkReferenceFile.R

checkReferenceFileR Documentation

Check a reference profiles file

Description

Given a reference profile file name the function attempts to load it and compare it to the mixture file to detect possible errors.

Usage

checkReferenceFile(filename, mix)

Arguments

filename

Path of the reference profiles file

mix

Data frame with mixture data

Details

See the relMix vignette for a description of the format of the reference file. The data frame with mixture data is used to compare If warnings are found, the function attempts to fix them and explains what it has done in the warning messages. If an error is found, checking stops and a NULL dataframe is returned. The error is described in the error messages.

Value

A list containing

  • df The loaded data frame, NULL if errors are present

  • warning A list of strings describing the errors that ocurred but could be fixed or that do not prevent the execution of the program.

  • error A list of strings describing the errors that ocurred that made it impossible to return a valid data frame. If this list is not empty, then the data frame item will be null.

Author(s)

Elias Hernandis

See Also

checkMixtureFile for information on how to load a mixture file.

Examples

## Not run: 
#Load a mixture file
mixfile <- system.file("extdata","mixture.txt",package="relMix")
mix <- checkMixtureFile(mixfile);
#Note: the mixture dataframe is passed as an argument. If the previous check failed,
#the program should not continue with the reference file check
reffile <- system.file("extdata","references.txt",package="relMix")
checkReferenceFile(reffile, mix$df);

## End(Not run)

gdorum/relMix documentation built on April 17, 2024, 8:49 p.m.