Generate water quality predictions for Chicago beaches, and upload to https://data.cityofchicago.org/Parks-Recreation/Beach-E-coli-Predictions/xvsz-3xcj
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Functions
credentials
csv
data
.gitignore
CONTRIBUTING.md
README.md
app.R
clear-water-app.Rproj
runapp.sh

README.md

Clear Water App

This is a companion repository to the Clear Water model repo for predicting beach water quality. It can be used as a production-ready solution to deliver model predictions to a Socrata data portal and map.

Notes

The file model.Rds is obtained by running Master.R in the Clear Water model repo. To generate the file, set the productionMode variable in the model repo to TRUE. Place the file in the data directory of this repo.

Make sure you also set the datasetUrl variable in app.R.

Socrata Credentials

To upload predictions to a Socrata portal, this application uses Chicago's RSocrata R package. You will have to authenticate with your data portal creditionals in order to add data to a predictions dataset. To authenticate with Socrata and upload predictions using this automated app, create files to save login and app token details in the credentials folder, named as follows:

  • email.txt
  • password.txt
  • token.txt

App.R will read these credentials and use them to send the data to the Socrata dataset.

Model Settings

This app is currently configured to predict water quality at beaches within a regional system. Specifically, it predicts the quality of some beaches along Chicago's Lake Michigan coastline based on the same-day bacteria observed at 5 predictor beaches.

Contributing

If you are interested in contributing to this project, see our Contribution Guide.