parse_HRV_reports: Parse LabChart's HRV Report

View source: R/HRV_reports.R

parse_HRV_reportsR Documentation

Parse LabChart's HRV Report

Description

Parse and transform LabChart's HRV report from a character vector to a tidy tibble

Usage

parse_HRV_reports(x, format_cols = TRUE)

Arguments

x

(Character) Character vectors of HRV report, each elements corresponding to one report.

format_cols

(Logical) If TRUE formats appropriate output variables as factor, integer, or double, and compute NN50_percent (pNN50) from NN50_count/Normals_count

Details

parse_HRV_reports() extracts key and value pairs from each fields of LabChart's HRV report supplied as character vectors using regular expression for pattern matching. Extracted data then transform into a tibble with "key" mapping to column names and "value" mapping to corresponding cells. If x is given as character vector of length > 1, there will be multiple rows of tibble with each rows corresponding to each input character vectors.

Value

A tibble of HRV report (one row per subject)

See Also

read_HRV_reports(): read LabChart's HRV report from file(s) path.

Examples

# Read HRV report to a character vector. Using any reading engine as you like.
hrv_chr <- readtext::readtext(labChartHRV_example("HRV/file1.txt"),
                              encoding = "UTF-16LE")$text
# Parse into a tibble
parse_HRV_reports(hrv_chr)

Lightbridge-KS/labChartHRV documentation built on June 12, 2022, 3:21 p.m.