read_any_breathtest {breathtestcore}R Documentation

Read breathtest files of any format

Description

Uses breathtest_read_function to determine the file type and reads it if it has a valid format.

Usage

read_any_breathtest(files)

Arguments

files

A single filename, a list or a character vector of filenames.

Value

A list of breathtest_data, even if only one file was passed. The list can be passed to cleanup_data to extract one concatenated data frame for processing with nls_fit, nlme_fit, null_fit (no processing) or stan_fit in separate package breathteststan.

Examples

files = c(
  group_a = btcore_file("IrisCSV.TXT"),
  group_a = btcore_file("350_20043_0_GER.txt"),
  group_b = btcore_file("IrisMulti.TXT"),
  group_b = btcore_file("NewBreathID_01.xml")  
 )
 bt = read_any_breathtest(files)
 str(bt, 1)
 # Passing through cleanup_data gives a data frame/tibble
 bt_df = cleanup_data(bt)
 str(bt_df)
 # If you want data only, use null_fit()
 plot(null_fit(bt_df))
 # Plot population fit with decimated data
 plot(nlme_fit(bt_df))

[Package breathtestcore version 0.8.7 Index]