Introduction

This guide walks through the basic steps of creating a Flexdashboard, setting up necessary packages, resolving common issues, and deploying your dashboard as a Shiny web app for the first time.


Step 1: Install Flexdashboard

To begin, install the flexdashboard package:

install.packages("flexdashboard")

Once installed, restart R and RStudio to avoid conflicts.


Step 2: Create a New Flexdashboard

To create your first dashboard:

  1. Go to FileNew FileR MarkdownFrom Template
  2. Choose Flex Dashboard
  3. Save the default template to your project folder
  4. Click Knit to render the dashboard as a static HTML page

✨ Before diving into interactivity, take a moment to explore the official Flexdashboard gallery & docs — it’s a colorful world of possibilities! 🌍📊 From dynamic charts to interactive maps 🗺️, you’ll find fantastic examples that spark ideas and show just how far you can go. Your dashboard adventure starts here! 🚀


Step 3: Enable Shiny Runtime

To make your dashboard interactive (using Shiny):

  1. Add the following line to the YAML header at the top of your Rmd file:
runtime: shiny
  1. Save the file
  2. Click Run Document (instead of Knit) to test the interactive dashboard locally

Step 4: (Optional) Fix Package

Some older packages may have Compatibility Issues throuwoing errprs. You can install archived versions manually as shown:

install.packages("https://cran.r-project.org/src/contrib/Archive/d3heatmap/d3heatmap_0.6.1.tar.gz", 
                 repos = NULL, type = "source")

install.packages("https://cran.r-project.org/src/contrib/Archive/metricsgraphics/metricsgraphics_0.9.0.tar.gz",
                 repos = NULL, type = "source")

Step 5: Deploying the Shiny App

1. Set Up a Shinyapps.io Account

install.packages("rsconnect")
library(rsconnect)
rsconnect::setAccountInfo(name='yourname', token='your_token', secret='your_secret')

2. Deploy the App

Use the deployApp() function from rsconnect:

rsconnect::deployApp(
  appDir = "path/to/your/app/folder",
  appName = "your_app_name",
  account = "your_account_name",
  appPrimaryDoc = "your_file.Rmd"
)

Example:

rsconnect::deployApp(
  appDir = "D:/UGA/AcademicCourseWork/Spring-2025/GradFIRST/Rcode/Shiny_Web_App/shiny_webpage/Small_Apps/TinyShinyApps",
  appName = "tinyApp_shine_4",
  account = "ecocliff",
  appPrimaryDoc = "shine_4.R"
)

Once deployed, your app will be live on the web!🎉

Check out my very first one here — yay to shiny beginnings! ✨🙌


Final Tips

  • Always test the app locally before deploying.
  • Use runtime: shiny only when interactivity is needed.
  • If your app includes data files, ensure they’re in the same directory or properly referenced.
  • For persistent issues, restart RStudio and recheck package versions.

Happy Shiny-ing! ✨

Now go forth and let your dashboards shine!