---
title: "Getting Started with pressR"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Getting Started with pressR}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
resource_files:
- figures/logo.svg
- figures/logo-dark.svg
---
[](https://github.com/CTTIR/pressR/actions/workflows/R-CMD-check.yaml)
[](https://cttir.github.io/pressR/)
[](https://CRAN.R-project.org/package=pressR)
[](https://app.codecov.io/gh/CTTIR/pressR?branch=main)
[](https://cran.r-project.org/package=pressR)
[](https://cran.r-project.org/package=pressR)
[](https://opensource.org/licenses/MIT)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.width = 6,
fig.height = 4,
dpi = 96
)
```
```{r setup, message=FALSE}
library(pressR)
```
## What pressR does
**pressR** parses, analyzes, and visualizes pressure distribution data
from capacitive sensor systems. It provides:
* Predefined sensor layouts (in-shoe insoles, pressure platforms, saddle
mats, seating mats, glove sensors),
* Parsers for ASCII and CSV pressure data files,
* A full analysis pipeline (per-frame metrics, trial summaries,
regional analysis, gait-cycle detection, saddle-fit checks),
* `ggplot2`-based visualization and composite reports,
* An interactive Shiny application for data exploration.
## Load a layout
Every trial is tied to a `pr_layout` object that describes the sensor
geometry. For example, a 99-sensor in-shoe pressure insole:
```{r}
layout <- pr_layout_insole()
print(layout)
```
## Generate a synthetic example trial
`pr_example_trial()` produces realistic synthetic data for each
supported application. This is useful for quick demos, tests, and
vignettes.
```{r}
trial <- pr_example_trial("insole")
trial
```
## Visualize
The default plot method draws a maximum-pressure picture (MPP):
```{r, fig.alt="MPP heatmap of the synthetic insole trial"}
pr_plot_heatmap(trial)
```
Time-domain curves are equally straightforward:
```{r, fig.alt="Force vs time with gait cycles shaded"}
pr_plot_force_time(trial, show_cycles = TRUE)
```
## Summarize
`pr_summary()` returns a single-row tibble containing the common
biomechanical parameters:
```{r}
pr_summary(trial)
```
## Regional analysis
With the insole layout's default region masks you get one row per
anatomical region:
```{r}
pr_calc_regional(trial)
```
## Export
Results can be exported as CSV:
```{r, eval=FALSE}
tmp <- tempfile(fileext = ".csv")
pr_export_csv(trial, tmp, what = "summary")
```
## Launch the Shiny app
```{r, eval=FALSE}
pr_run_app(trial)
```