vedhav / teal.gallery

A Gallery of Exploratory Web Apps used for Analyzing Clinical Trial Data

Home Page:https://vedhav.github.io/teal.gallery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

teal.gallery

A gallery of sample apps based on the teal framework.

Links to apps on shinyapps.io

Development version

Usage

Installation

After you've cloned this repository locally, simply run the following commands in an R session with your current working directory set to the base of the cloned repository.

Feel free to check out any branch after you've cloned this repository. Dependencies will be automatically installed in the steps provided below.

# Set your Github and Gitlab PATs
# You might have already set these. If not, do so here.
Sys.setenv("GITHUB_PAT" = "<token>")
Sys.setenv("GITLAB_PAT" = "<token>")

# Install staged.dependencies
remotes::install_github(
  "openpharma/staged.dependencies",
  upgrade = "never"
)

# Set token mappings
options(
  staged.dependencies.token_mapping = c(
    "https://github.com" = "GITHUB_PAT",
    "https://gitlab.com" = "GITLAB_PAT"
  )
)

# Install deps and this project
staged.dependencies::install_deps(
  staged.dependencies::dependency_table()
)

Listing Apps

You can list all available apps by running:

teal.gallery::list_apps()

Running an app

Launch an app by running:

# Say you want to run the `basic-teal` app
teal.gallery::launch_app("basic-teal")

Deployments

To deploy a specific app to shinyapps.io to an internally hosted Posit Connect server, run:

# Assuming you want to deploy the basic-teal app
teal.gallery:::deploy_app(
  app_name = "basic-teal",
  app_title = "Basic Teal App - TEST",
  vanity_url = "/NEST/basic-teal-test",
  api_key = "SHINYAPPS_OR_POSIT_CONNECT_API_TOKEN",
  api_secret = "SHINYAPPS_OR_POSIT_CONNECT_API_SECRET" # N/A for Posit Connect
)

To deploy all apps from this package to shinyapps.io to an internally hosted Posit Connect, run:

teal.gallery:::deploy_all_apps(
    api_key = "SHINYAPPS_OR_POSIT_CONNECT_API_TOKEN"
    api_secret = "SHINYAPPS_OR_POSIT_CONNECT_API_SECRET" # N/A for Posit Connect
)

Development

All teal sample apps are wrapped into this package for the sake of portability. All development standards and practices that we currently use for R package development also apply to this repository.

Adding a sample app to teal.gallery

Adding a sample app involves the following steps:

  1. Copy each sample app into a file named app.R into a sensible folder name inside the inst/apps directory
  2. Update the first test in the package to list all the app names (i.e. populate the expected_apps vector with the new app name)
  3. Add into the package Suggests in the DESCRIPTION file any dependencies that were explicitly used in app.R for the sample app. To do so, invoke renv::dependencies("path_to_file")) to see a list of dependencies.
  4. Update the upstream dependencies of the staged_dependencies.yaml file of this package and the downstream dependencies of the packages that were added in the previous step.

About

A Gallery of Exploratory Web Apps used for Analyzing Clinical Trial Data

https://vedhav.github.io/teal.gallery

License:Other


Languages

Language:R 100.0%