--- 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 --- [![R-CMD-check](https://github.com/CTTIR/pressR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CTTIR/pressR/actions/workflows/R-CMD-check.yaml) [![pkgdown](https://github.com/CTTIR/pressR/actions/workflows/pkgdown.yaml/badge.svg)](https://cttir.github.io/pressR/) [![CRAN status](https://www.r-pkg.org/badges/version/pressR)](https://CRAN.R-project.org/package=pressR) [![Codecov test coverage](https://codecov.io/gh/CTTIR/pressR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/CTTIR/pressR?branch=main) [![CRAN downloads](https://cranlogs.r-pkg.org/badges/pressR)](https://cran.r-project.org/package=pressR) [![CRAN downloads total](https://cranlogs.r-pkg.org/badges/grand-total/pressR)](https://cran.r-project.org/package=pressR) [![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](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) ```