-
Notifications
You must be signed in to change notification settings - Fork 1
/
readme.rmd
101 lines (73 loc) · 3.48 KB
/
readme.rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
cache = TRUE,
comment = "#>",
fig.path = "man/figures/",
out.width = "100%"
)
```
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/card)](https://CRAN.R-project.org/package=card)
[![](http://cranlogs.r-pkg.org/badges/grand-total/card?color=blue)](https://cran.r-project.org/package=card)
[![R-CMD-check](https://github.com/shah-in-boots/card/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/shah-in-boots/card/actions/workflows/R-CMD-check.yaml)
[![pkgdown](https://github.com/shah-in-boots/card/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/shah-in-boots/card/actions/workflows/pkgdown.yaml)
[![test-coverage](https://github.com/shah-in-boots/card/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/shah-in-boots/card/actions/workflows/test-coverage.yaml)
[![Codecov test coverage](https://codecov.io/gh/shah-in-boots/card/branch/main/graph/badge.svg)](https://app.codecov.io/gh/shah-in-boots/card?branch=main)
[![Github commit frequency](https://img.shields.io/github/commit-activity/w/shah-in-boots/card)](https://github.com/shah-in-boots/card/graphs/commit-activity)
<!-- badges: end -->
# __card__
## Cardiovascular Applications for Research Data
The inspiration for `{card}` was to create useful functions and analytical approaches in computational neurocardiology, with a on electrocardiography and epidemiology.
The areas of focus of this package are the following:
- handling of recurrent and circadian events
- epidemiological focus on effective model building
## Installation
You can install the released version of `{card}` from [CRAN](https://CRAN.R-project.org) with:
```{r, eval=FALSE}
install.packages("card")
```
And the development version from [GitHub](https://github.com/) with:
```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("shah-in-boots/card")
```
## Usage
The intent for this `card` is to develop several key functions for the analysis of recurrent or cyclical data, and assistance with epidemiological approaches to regression modeling.
The key features are:
1. Sample datasets
2. Cosinor analysis
3. Recurrent events
4. Model building
```{r}
library(card)
```
### Datasets
* Cardiovascular disease outcomes with recurrent events
* Vectorcardiography data in a high-risk cohort
* Continuous electrocardiography recordings in a clinical cohort with quantitative stress data
```{r}
# ECG data
data("twins")
head(twins)
# Outcomes data
data("stress")
head(stress)
# VCG data
data("geh")
head(geh)
```
### Cosinor Analysis
This modeling algorithm requires only base `R`, which allows internal flexibility for modeling heuristics and improved efficiency. For the user, it also allows standard modeling tools/approaches, and a flexible user interface that accounts for individual/population analysis and single/multiple component analysis.
There are other cosinor models available in `R`, however they do not allow for simple multiple-component or individual/population analysis in a method that is tidy (for both `tidyverse` and `tidymodels` approaches).
```{r}
m <- cosinor(rDYX ~ hour, twins, tau = c(24, 12))
summary(m)
ggcosinor(m)
head(augment(m))
```