Skip to content

joa-kenit/DataPlus2022-data

Repository files navigation

DataPlus2022-data

Welcome to our Data Plus project for summer 2022! The goal of this project was to create a dashboard to display and explore water quality data that would otherwise be difficult to access. Our focus is on the Ellerbe Creek Watershed, with our data coming from our corresponding Bass Connections team at Duke and the City of Durham. Below is a description of all of the files we used and how they contribute to our final product. The website can be found here: https://dukerivercenter.shinyapps.io/EllerbeCreekWatershedData/.

shinyDashboard

ui.R file

The UI file is the framework for the front-end of the website, controlling the organization of the different tabs and features we implemented. This is the front-end of the different interactive plots and maps we include.

server.R file

The server file enables the back-end functionality of the website, including the functions and code that are used to produce our vizualitations.

Global.R file

The Global file allows us to reduce redundant code and increase efficiency for our app by reading in data sets and loading packages in the global scope of the R environment. The objects we store within this file can be accessed from the server and UI files in designing the website.

www folder

The www folder within the shinyDashboard folder contains some of the different files used in our shiny app (especially files such as images). These files are read in from the Global.R file.

.github/workflows folder

This folder contains the main.yml file, which contains code that scrapes the website that our ambient data is pushed too. When the ambient data set is updated by Durham, that same data set is updated within the updatedData folder (see below section for more). When the Shiny App is run, it then requests data from GitHub which contains the updated data.

updatedData

This folder contains the data sets that the Shiny App pulls from while it runs. Because the water quality data being used is pulled from git, this allows further updates with the website whether it's through the Bass Connections team adding their new results or the automatic updating of ambient data.

oldData

Default data in the case that Durham alters or abandons their system of updating data to their water quality website. The data is from June 2022.

Tips and Guidance

Publishing the Website with new Changes

Code as an alternative to using the publish button option in RStudio:

install.packages("rsconnect")

rsconnect::setAccountInfo(name='dukerivercenter', token='9CA757C8DF1F78F7C8C0DC1D4FFE1DEB', secret='')

#change "path/to/your/app"

rsconnect::deployApp('path/to/your/app')

#if you want to access to the library:

library(rsconnect)

To Keep in Mind when Running on Local Machine

  • The server has access to all of the R Environment, including objects not in the Shiny App; Make sure the site is able to run with a clear enviornment in RStudio (command: rm(list = ls()))
  • To run the Global file again, closing the app and re-running it is necessary. Reloading the app does not suffice.
  • Open the app in browser to get the full functionality of the site.

Visual of the Website

For those looking for a glimpse of the site without running it, below are some screenshots of what it looks like:

Homepage: Screen Shot 2022-07-28 at 11 10 00 AM

Interactive Features:

Screen Shot 2022-07-28 at 11 14 03 AM

Screen Shot 2022-07-28 at 11 16 18 AM

Screen Shot 2022-07-28 at 11 16 56 AM

About

Website developed for the project "A city and its river", as part of the Duke University fellowship "Data Plus 2022"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published