The goal of shinystats is to make shiny apps that explain statistical concepts. The apps are designed to be light-weight (no extra packages) and fast so that they can be used in quarto presentations with shinylive.

Installation and Use

You can install shinystats from GitHub with:

# install.packages("pak")
pak::pak("biostats-r/shinystats")

To use shinystats in a quarto document with shinylive, you also need to do the following:

  1. Install shinylive from CRAN with install.packages("shinylive")

  2. Install shinylive assets with shinylive::assets_ensure()

  3. Add the following to the YAML header of your quarto document:

format: 
  html:
    resources: 
      - shinylive-sw.js
filters:
  - shinylive

Shinylive also works with revealjs presentations. Simply substitute html with revealjs in the YAML header.

  1. Add a shinylive-r code chunk that runs the app:
```{shinylive-r}
#| label: power-app
#| standalone: true
#| viewerHeight: 600

shinystats::ar_app()
```
  1. Render the document

Example

Here is a sample quarto document that uses shinystats.

---
title: "shinystats demo"
format:
  html:
    resources:
      - shinylive-sw.js
filters:
  - shinylive
---


App should appear below. Might take a while to load.

```{shinylive-r}
#| label: ar-app
#| standalone: true
#| viewerHeight: 600

shinystats::ar_app()
```

Available Apps

Power analysis

Linear regression

Autocorrelation