Learn R Programming

breathtestcore (version 0.8.7)

breathtest_read_function: Snoop method to read breath test file

Description

Reads the first line of a file, and returns the best matching function to read the breath test data in it. To automatically read the file with the inferred file type, use read_any_breathtest. For Excel files, only the first sheet is read.

Usage

breathtest_read_function(filename = NULL, text = NULL)

Value

Function to read the file or the text; NULL if no matching function was found

Arguments

filename

breath test data file from Iris/Wagner (extended or CSV), BreathID

text

as alternative to filename, pass the text of the file directly. This parameter is not used for Excel files.

Examples

Run this code
 file = btcore_file("IrisCSV.TXT")
 # Get function to read this file. Returns \code{\link{read_iris_csv}}.
 read_fun = breathtest_read_function(file)
 str(read_fun(file))
 # or, simple (returns a list!)
 str(read_any_breathtest(file), 1 )
 

Run the code above in your browser using DataLab