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

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

## Overview

The `fgdiR` package computes the Functional Gait Deviation Index (FGDI) for quantifying gait pathology using multivariate functional principal components.

## Example Usage

### Load Amputee Data

```{r}
data(A_Data)
data(A_data_info)
```

### Compute FGDI

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

### Visualize One Joint Comparison

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