generated from jhudsl/OTTR_Template_Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
googleforms.Rmd
59 lines (44 loc) · 2.47 KB
/
googleforms.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: "Google Forms"
output:
html_document:
toc: true
toc_float: true
toc_collapsed: true
date: "`r format(Sys.time(), '%d %B, %Y')`"
---
## Preview
```{r, echo = FALSE, hide = TRUE, message = FALSE}
root_dir <- rprojroot::find_root(rprojroot::has_dir(".git"))
yaml <- yaml::read_yaml(file.path(root_dir, "_config_automation.yml"))
## For google forms
googleform_1 <- readr::read_tsv(file.path("metricminer_data", "googleforms", "a_cool_survey.tsv"))
googleform_2 <- readr::read_tsv(file.path("metricminer_data", "googleforms", "another_even_cooler_survey.tsv"))
```
```{r}
googleform_1
googleform_2
```
## Setting up Google Forms
[Follow the steps from the above section to authenticate Google](#setting-up-google-authentication) -- make sure that the account you have authenticated for has access to the Google Forms you wish to collect.
Go to a form you'd like to collect data from. The URL should look something like this:
```
https://docs.google.com/forms/u/1/d/<GOOGLE_FORM_ID_HERE>/edit?usp=drive_web
```
Extract the Google Form ID from the URL and put it in the `google_forms` section of the `_config_automation.yml` file.
Do this for each form you'd like to collect data from and separate the form IDs with commas. Delete the example IDs we have put there as placeholders.
```
###### Google Forms ######
refresh-googleforms: yes
google_forms: [
1pbFfgUPYH2w9zEoCDjCa4HFOxzEhGOseufw28Xxmd-o,
1JjmsiuVoGSxvl-1M_oWittcftO955tijzeNc-cgJlo8 ]
googleforms_googlesheet:
```
- [ ] In the `config_automation.yml` file, make sure that `refresh-googleforms` is set to "yes".
- [ ] Optionally, if you are saving data to Google, specify a googlesheet ID in `googleforms_googlesheet` you'd like the GitHub data to be saved to. This will only be relevant if you've set `data_dest` to `google`.
## Customizing the Google Forms Data
In order to customize the data you are downloading from your Google Forms you can modify the
`refresh-scripts/refresh-googleforms.R` script in your repository.
You can take a look at the [`metricminer` R package documentation](https://hutchdatascience.org/metricminer/articles/getting-started.html) for more details about the functions and what is possible.
If you have a metric need that is not currently fulfilled by `metricminer` or `metricminer-dashboard` we encourage you to [file a GitHub issue with us and let us know about your new feature idea (or bug report)](https://github.com/fhdsl/metricminer/issues/new/choose).