knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
R package :package: for LabChart's Heart Rate Variability Data
{labChartHRV}
is an R package which contains functions for data import and manipulation of LabChart's HRV module.
Use case
.txt
) into a tibble (data frame).You can install the development version of labChartHRV from GitHub with:
{remotes}
package by (skip If you already have):install.packages("remotes")
{labChartHRV}
package by:remotes::install_github("Lightbridge-KS/labChartHRV")
This is a LabChart's HRV report file (.txt
) of 1 subject.
How to transform it into a 1-row data frame for further analysis?
Moreover, If we have multiple of these text files, how can we transform it into a data frame which has each rows corresponding to each subjects?
{labChartHRV}
package has functions to solve this problems
library(labChartHRV)
This package comes with example data of LabChart's HRV report file(s) in .txt
.
# Path to a folder containing example HRV report text files path_hrv <- labChartHRV_example("HRV") dir(path_hrv)
Read HRV report file(s) from .txt
to a data frame by calling read_HRV_reports()
with path to either single HRV report or folder containing multiple reports.
# Read multiple HRV report files from a folder hrv_tbl <- read_HRV_reports(path_hrv) hrv_tbl
hrv_tbl
is a tibble (data frame)
Columns are variables including the results from time-and frequency-domain HRV analysis.
Rows corresponding to report files (i.e., each subjects).
# Variable names names(hrv_tbl)
Variable's description are store in this data frame:
HRV_vars_desc
If you want to collaborate to add more function to this package, feel free to contact me at kittipos.sir\@mahidol.edu.
Last updated: r Sys.Date()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.