An open API service indexing awesome lists of open source software.

https://github.com/lightbridge-ks/labcharthrv

R package 📦 for LabChart's HRV data
https://github.com/lightbridge-ks/labcharthrv

data-import hrv labchart r rpackage

Last synced: 6 months ago
JSON representation

R package 📦 for LabChart's HRV data

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# labChartHRV

[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![R-CMD-check](https://github.com/Lightbridge-KS/labChartHRV/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Lightbridge-KS/labChartHRV/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/Lightbridge-KS/labChartHRV/branch/main/graph/badge.svg)](https://app.codecov.io/gh/Lightbridge-KS/labChartHRV?branch=main)
[![DOI](https://zenodo.org/badge/480112543.svg)](https://zenodo.org/badge/latestdoi/480112543)

> **R package :package: for LabChart's Heart Rate Variability Data**

# Overview

`{labChartHRV}` is an R package which contains functions for data import and manipulation of [LabChart's HRV module](https://www.adinstruments.com/products/hrv).

**Use case**

- Import and transform LabChart's HRV report file (`.txt`) into a tibble (data frame).

# Installation

You can install the development version of labChartHRV from [GitHub](https://github.com/) with:

- Install `{remotes}` package by (skip If you already have):

``` r
install.packages("remotes")
```

- Install `{labChartHRV}` package by:

``` r
remotes::install_github("Lightbridge-KS/labChartHRV")
```

# Problems

This is a LabChart's HRV report file (`.txt`) of 1 subject.

![](man/figures/hrv-rep-ex1.png)

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

# Usage

```{r}
library(labChartHRV)
```

This package comes with example data of LabChart's HRV report file(s) in `.txt`.

```{r path_hrv}
# 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.

```{r hrv_tbl}
# 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).

```{r}
# Variable names
names(hrv_tbl)
```

Variable's description are store in this data frame:

```{r}
HRV_vars_desc
```

# Learn more

- [Get started using labChartHRV](https://lightbridge-ks.github.io/labChartHRV/articles/labChartHRV.html)

# Collaboration

If you want to collaborate to add more function to this package, feel free to contact me at [kittipos.sir\@mahidol.edu](mailto:kittipos.sir@mahidol.edu).

------------------------------------------------------------------------

Last updated: `r Sys.Date()`