CamML uses Google Sheets to record user labelling responses and Google Drive to save the images being labeled.
After we create a spreadsheet and folder, we will copy their IDs into an R file that will be loaded by the app as environment variables.
We will create the R file now so we can copy the IDs in when ready.
- Open RStudio
- Click File > Open Project, navigate to the GitHub repo folder, and open the R project file (.RProj)
- Create a new file (File > New File) called
google_keys.R, and paste in the following code:
- Save the file, and keep it open so we can paste in the IDs when ready!
Navigate to Google Drive while signed into your Google Account. Click the New button in the top left, and select Google Sheets. Name the spreadsheet something meaningful, such as Flood CamML responses.
The CamML app writes a few columns worth of data, and it is important to have the columns names and order of column names exact. Create column names following example convention below:
|2021-07-28 13:11:24||Mirlo||Mirlo_2021-07-28 13:11:23.jpg||0.01||No Flooding||No Flood|
Datetimes are reported in UTC in the spreadsheet, but by default are displayed as EST/EDT in the CamML App.
Sharebutton in the top-right, and paste the service account email into the text box to share the spreadsheet with the service account. Accept the default properties (Editor), and click Done.
We need to copy the ID of the spreadsheet into
google_keys.Rso the app knows what spreadsheet to write to. The easiest way to do this is to copy the ID from the URL for the spreadsheet. The ID will be an extremely long string of characters and symbols between two forward slashes.
From the URL
https://docs.google.com/spreadsheets/d/very-long_string_ofRandom.characters-isTheKey!/edit#gid=0, the ID would be
google_keys.R file should now look like below (except with your actual ID, of course!)
At the Drive homepage, click the New button in the top left, and select Folder. Name the folder something meaningful, such as Flood CamML Images.
Sharebutton in the top-right, and paste the service account email into the text box to share the folder with the service account. Accept the default properties (Editor), and click Done.
Double click on your new folder, and copy the folder ID from the URL just like you did for the spreadsheet. The folder ID is likely located at the end of the URL rather than between forward slashes.
Copy the folder ID into
Now that we have all Google components set up, we're ready to customize the app!