Low-Cost Air Quality Monitoring Packages

Developed by Mike Bergin Lab at Duke University

Installation of Data Visualization Software

We use R studio and the Shiny app, which are free and available online, to visualize the data from our sensors. We have written code for 2 apps:

  1. The Plotter App - used to visualize data over time from one or multiple sensor packages simultaneously
  2. The Calibrator App - used to compare data from 2 sensors, or to compare data between a sensor and a reference monitor (i.e., for calibration purposes)

  1. Download R version 2.11.1 or higher Note that if you are a Mac user, you will be asked to install XQuartz
  2. download R
  3. Install RStudio
  4. install R Studio
  5. Install Shiny web application framework in RStudio. Go to the “Packages” tab, click “Install”, and type in “shiny”. Make sure that the “Install dependencies” checkbox is selected.
  6. install Shiny App install Dependencies

To set up RStudio for data visualization:

  1. If you have not already, install the “shiny” and “xts” packages, as well as their dependencies. Refer to steps 3 and 4 of the previous section, “Setup: Installation”, for instructions.
  2. Make a folder where you want to store this project, and create two directories “Calibrator” and “Plotter” within. You can create new folders from within RStudio by clicking on “New Folder” under the “Files” tab. The example uses “Summer 2016” as the name of the parent folder. You can do this in your computer’s File explorer program. Don’t worry about doing it in R.
  3. create folder
  4. Within the “Calibrator” folder, place the scripts “app.R”, “AvgTime.R”, “CalConst.R”, “Calibration.R”, and “ShortCut2.R”. In addition, create the new folder “Data”. Within the “Data” folder, create the new folders “Raw Data”, “Cleaned Data”, “Formatted Data”, “Ready Data” and “Calibration Constants”.
  5. scripts
  6. Similarly, within the “Plotter” folder, place the scripts “app.R” and “ShortCut2.R”. In addition, create the new folder “Data”. Within the “Data” folder create the new folders “Raw Data”, “Cleaned Data”, “Formatted Data”, and “Ready Data”.
  7. At this point, you are set to start using the apps. The files that you have should look the same as how the files are stored in the “Summer 2016” Duke Box folder, which is:
  8. scripts

If additional files “.RData” and “.Rhistory” appear, you can disregard them as they will not affect the apps