jofaichow commited on
Commit
c6e84e1
1 Parent(s): 4b527a7

0.2.6 - added survey results

Browse files
Files changed (1) hide show
  1. app/app.R +29 -28
app/app.R CHANGED
@@ -30,15 +30,6 @@ options(timeout = max(1000, getOption("timeout")))
30
  ls_username <- sort(get_leaderboard()$username)
31
 
32
 
33
- # Pre-download Survey Results
34
- gs4_deauth()
35
- d_survey_raw <- read_sheet(ss = "https://docs.google.com/spreadsheets/d/18AM4RkG5KiK3TlDGMx0z7X5Y5-eQE9kgLXM9ng_yXUk",
36
- sheet = "Form responses 1") %>% data.table()
37
- colnames(d_survey_raw) <- c("timestamp", "country", "comments")
38
-
39
-
40
-
41
-
42
 
43
  # ==============================================================================
44
  # Helper Functions
@@ -1039,6 +1030,11 @@ server <- function(input, output) {
1039
 
1040
  output$dt_survey_summary <- DT::renderDT({
1041
 
 
 
 
 
 
1042
 
1043
  # Summarise
1044
  d_survey_summary <-
@@ -1072,26 +1068,31 @@ server <- function(input, output) {
1072
 
1073
 
1074
  output$dt_survey_raw <- DT::renderDT({
1075
-
1076
- # Return
1077
- # Return
1078
- DT::datatable(
1079
-
1080
- # Data
1081
- d_survey_raw,
1082
-
1083
- # Other Options
1084
- rownames = FALSE,
1085
- # extensions = "Buttons",
1086
- options =
1087
- list(
1088
- dom = 'Blrtip', # https://datatables.net/reference/option/dom
1089
- pageLength = 20,
1090
- lengthMenu = c(10, 20, 100, 500)
1091
- )
1092
- )
1093
 
1094
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1095
 
1096
 
1097
 
 
30
  ls_username <- sort(get_leaderboard()$username)
31
 
32
 
 
 
 
 
 
 
 
 
 
33
 
34
  # ==============================================================================
35
  # Helper Functions
 
1030
 
1031
  output$dt_survey_summary <- DT::renderDT({
1032
 
1033
+ # Get Raw Data
1034
+ gs4_deauth()
1035
+ d_survey_raw <- read_sheet(ss = "https://docs.google.com/spreadsheets/d/18AM4RkG5KiK3TlDGMx0z7X5Y5-eQE9kgLXM9ng_yXUk",
1036
+ sheet = "Form responses 1") %>% data.table()
1037
+ colnames(d_survey_raw) <- c("timestamp", "country", "comments")
1038
 
1039
  # Summarise
1040
  d_survey_summary <-
 
1068
 
1069
 
1070
  output$dt_survey_raw <- DT::renderDT({
1071
+
1072
+ # Get Raw Data
1073
+ gs4_deauth()
1074
+ d_survey_raw <- read_sheet(ss = "https://docs.google.com/spreadsheets/d/18AM4RkG5KiK3TlDGMx0z7X5Y5-eQE9kgLXM9ng_yXUk",
1075
+ sheet = "Form responses 1") %>% data.table()
1076
+ colnames(d_survey_raw) <- c("timestamp", "country", "comments")
1077
+
1078
+ # Return
1079
+ DT::datatable(
 
 
 
 
 
 
 
 
 
1080
 
1081
+ # Data
1082
+ d_survey_raw,
1083
+
1084
+ # Other Options
1085
+ rownames = FALSE,
1086
+ # extensions = "Buttons",
1087
+ options =
1088
+ list(
1089
+ dom = 'Blrtip', # https://datatables.net/reference/option/dom
1090
+ pageLength = 20,
1091
+ lengthMenu = c(10, 20, 100, 500)
1092
+ )
1093
+ )
1094
+
1095
+ })
1096
 
1097
 
1098