A system for creating Shiny dashboards using Excel spreadsheets.
You can install the development version of ExcelToShiny from GitHub with:
install.packages("devtools")
devtools::install_github("IDEMSInternational/ExcelToShiny")ExcelToShiny enables users to define Shiny dashboards using Excel spreadsheets. This approach makes it easy to specify dashboard components, including:
- Main Page: Global dashboard settings.
- Contents Page: Defines the structure of the Shiny app.
- Display Pages: Creates different visualization components.
- Tabbed Pages: Organises pages into tabbed layouts.
- Download Pages: Allows data downloads with optional access control.
Below is an example of how to load an Excel file and use it to generate a Shiny dashboard:
# Load libraries
library(ExcelToShiny)
library(dplyr)
library(rio)
library(NHANES)
# Load your data you want to run
data(NHANES)
# Run manipulations. Here's an example of where we use a second data frame in our Shiny Excel
NHANES_by_ind <- NHANES %>%
dplyr::group_by(ID) %>%
dplyr::mutate(count = 1:n()) %>%
dplyr::filter(count == 1) %>%
dplyr::ungroup()
# Set the key variable to be the same type
NHANES$ID <- as.character(NHANES$ID)
NHANES_by_ind$ID <- as.character(NHANES_by_ind$ID)
# Run any credentials data for downloading page
credentials_data <- data.frame(
user = "admin",
password = "password",
stringsAsFactors = FALSE
)
# Call in the test data
path <- system.file("extdata", "example_data.xlsx", package = "ExcelToShiny")
all_sheets <- rio::import_list(path)
# Your shiny app
build_shiny(
title = "Test Dashboard",
data_list = all_sheets,
data_frame = NHANES,
key_var = "ID"
)We welcome contributions from the community to enhance the
ExcelToShiny package. If you would like to contribute, please follow
these guidelines:
-
Contribute to the software: If you wish to contribute new features, fix bugs, or improve the documentation, please fork the repository, create a new branch for your changes, and submit a pull request. Ensure that your code follows the existing style and include tests where applicable.
-
Report issues or problems: If you encounter a bug or have a feature request, please open an issue in the GitHub Issues section. Provide as much detail as possible, including steps to reproduce the issue if applicable.
-
Seek support: For any questions or help with using
ExcelToShiny, you can reach out by opening a discussion in the GitHub Discussions, or open a new issue with a “Question” label. We aim to respond within a week.
We appreciate your contributions and feedback!