This shiny app is built with R. To use this repository effectively, I would assume that you have taken STAT 220 at Carleton, or have previous experience developing shiny apps. Carleton provides two servers (maize) for students to access Posit Workbench remotely. If you don't already have a machine that runs RStudio locally, you can use the Maize servers to clone and update this repository. Visit the Carleton Math and Stats Department website for more help. Note that this shiny app is memory intensive (it frequently requires over 1 GB of memory), so a local machine is recommended (but not required).
This repository is public, but the PAC Office has GitHub account that has direct access as a collaborator. If you wish to be added as a collaborator, contact Alexi Carlson ([email protected]) for access.
We use version control to keep track of changes and eventually collaborate between different students who contribute to this project.To do this, you need to set up version control on either your local machine or maize. Here's a tutorial on how to do it.
Once you set up version control, you'll be able to pull and push from this GitHub repository. Simply copy the url, and start a new project in RStudio: File > New Project > Version Control > Git. Paste the repository URL in the Repository URL
. For more information, here's a detailed tutorial on how to connect RStudio to Git and GitHub.
Now you've set up your RStudio to connect to github. You can finally start the development process. To make any changes and let GitHub remember those changes for you, you'll need to commit and push the changes to this repository. Think of this as saving, undo, and redo in any text editing software, but with code stored in GitHub. Here's a demo.
Change anything in the following chunk:
git status
git add
git commit
Now save your changes by pressing control + s
or command + s
. Go to the Git
tab in RStudio, check the staged column of the file that you just changed. In this case, it'll be README.md
. Hit Commit
, and it'll prompt you with a new window to enter the commit message. Briefly describe what you just did in commit message and hit Push
. Now when you refresh the web browser of this repository, you'll see the update readme with the commit message that you sent. Note that if you're working with a partner, or that there are multiple users committing to this repository, you'll need to pull before you push. Make sure your local version is up to date before you push any changes. Otherwise, this will result in a merge conflict. If you do run into that situation, here's a tutorial on how to resolve them.
The root folder contains several files that were used in a development report. The Rmd
of the same name as this repo was used to generate graphs to present to the Music Department. The individual data sets (.tsv
and .csv
files) and the data
folder were the data sources for that.
The folder of the most interest to developers would be the PAC-data-analyzer
folder which contains the shinyapp itself and a duplicate of the data folder, along with other data sets. We pull from Google Sheets as our data source, so if you ever want to go back and edit any entries, you can do so in Google Sheets and upload that as a new data set. Contact Alexi Carlson ([email protected]) for administrative access to the Google Sheet.
The shiny app is published under the shiny account of the PAC Office. You can make changes to the shiny app (app.R
) and publish to the same destination. Contact Alexi Carlson ([email protected]) for user name and password.
Once you have access to the shiny account of the PAC Office, go under: Account > Tokens > Show > Show Secrete > Copy to clipboard. With the token, go into the shiny app, hit Publish > Other Destination > Add new account > Shinyapps.io, paste the token into the window, and connect account. Once it's connected, you can publish the newly edited website to the PAC Office shiny account. For more information, refer to this tutorial.