---
title: "Parkinson Gait Analysis using fgdiR"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Parkinson Gait Analysis using fgdiR}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(fgdiR)
library(dplyr)
library(tidyr)
library(magrittr)
```

## Overview

This vignette demonstrates how to compute and visualize FGDI for subjects with Parkinson's disease.

## Load Parkinson Data

```{r}
data(P_Data)
data(P_data_info)
```

### Assign Labels and Compute FGDI

```{r}
ID <- c(rep("Case", 21), rep("Control", 42))
fgdi_out <- FGDI(P_Data, ID, PVE_I=0.99)
```

### Visualize an Example Joint

```{r fig.width=6, fig.height=4}
plot_gait_comparison(1, "Pelvis Tilt (Parkinson)", fgdi_out, P_Data, ID, combined=TRUE)
```
