read_breathid_xml {breathtestcore}R Documentation

Read new BreathID/Examens XML file

Description

Reads 13c data from an XML BreathID file, and returns a structure of class breathtest_data_list, which is a list with elements of class breathtest_data.

Usage

read_breathid_xml(filename = NULL, text = NULL)

Arguments

filename

name of xml-file to be read

text

alternatively, text can be given as string

Value

List of class breathtest_data_list of structures of class breathtest_data; an XML file can contain multiple data sets.

Examples

filename = btcore_file("NewBreathID_01.xml")
# Show first lines
cat(readLines(filename, n = 10), sep="\n")
bid = read_breathid_xml(filename)
# List with length 1
str(bid, 1)
filename = btcore_file("NewBreathID_multiple.xml")
bids = read_breathid_xml(filename)
str(bids, 1) # 3 elements - the others in the file have no data
# Create hook function to deselect first record
choose_record = function(records) {
  r  = rep(TRUE, length(records))
  r[1] = FALSE
  r
}
options(breathtestcore.choose_record = choose_record)
bids = read_breathid_xml(filename)
str(bids, 1) # 2 elements, first deselected



[Package breathtestcore version 0.8.1 Index]