-
Notifications
You must be signed in to change notification settings - Fork 0
/
survey.Rmd
129 lines (109 loc) · 4.62 KB
/
survey.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
title: "Survey results"
author: "Adrian Barnett"
date: "`r format(Sys.time(), '%d %B %Y')`"
output: word_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE, comment='', dpi=400)
options(width=1000, scipen = 999) # Wide pages and no scientific numbers
library(dplyr)
library(tidyr)
library(ggplot2)
cbbPalette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
library(pander)
panderOptions('table.emphasize.rownames', FALSE)
panderOptions('table.split.table', Inf)
library(stringr)
## read survey data
data = read.csv('ExportToCSV192936.csv', skip=4, header=TRUE, stringsAsFactors = FALSE, fileEncoding="UTF-8") %>%
rename('id'= 'X', 'date'= 'X.1', 'email'='X.2', 'list'='X.3',
'list.policy'='X.4', 'your'='X.5', 'your.institute'='X.6', 'field'='X.7')
# remove missing responses
missing = select(data, -date, -email) %>%
gather(key = "key", value = "answer", -id) %>%
group_by(id) %>%
summarise(msum = sum(answer=='')) %>% # count missing
filter(msum >= 47)
# now remove from data
data = filter(data, id%in% missing$id == FALSE)
## switch data to long format
# Q1
problems = select(data, 4:23) %>%
gather(key='Problem') %>%
filter(!is.na(value) & value !='') %>%
group_by(Problem) %>%
summarise(count = n()) %>%
arrange(- count) %>%
mutate(Problem = str_replace_all(string=Problem, pattern='\\.', replacement = ' '),
Problem = str_replace_all(string=Problem, pattern=' e g ', replacement = ' e.g., ')
)
# Q2
other.problems = select(data, 24) %>%
filter(list != '') %>%
mutate(list = str_replace(string=list, pattern="^\\(", replacement = "")) # to make sure this papers as a bullet
# Q3
policies = select(data, 25:45) %>%
gather(key='Policy') %>%
filter(!is.na(value) & value !='') %>%
group_by(Policy) %>%
summarise(count = n()) %>%
arrange(- count) %>%
mutate(Policy = str_replace_all(string=Policy, pattern='\\.', replacement = ' '),
Policy = str_replace_all(string=Policy, pattern=' e g ', replacement = ' e.g., ')
)
# Q4
other.policies = select(data, list.policy) %>%
filter(list.policy != '')
# Q5
other.you = select(data, your) %>%
filter(your != '')
# Q6
other.inst = select(data, your.institute) %>%
filter(your.institute != '')
```
There were `r nrow(data)` responses.
## Of the following 20 problems in research, please select which five (or fewer) you think are the most important to address. Please focus on the most important national issues for Australia.
```{r}
pander(problems, split.cells=80)
```
## Are there other major problems in research in Australia that we should consider at the meeting?
```{r, results='asis'}
pandoc.list(other.problems$list)
```
## Which of the following 21 potential policy changes or actions would you endorse to help improve research in Australia?
```{r}
pander(policies, split.cells=80)
```
## Please suggest other possible policy changes or actions
```{r, results='asis'}
pandoc.list(other.policies$list.policy)
```
## Please share the policies or practices that you use in your own research to maximise research quality. If there are none then please write 'None'. All answers are anonymous.
```{r include=FALSE}
# count number that said 'none' and add as separate text
none.text = '^none|^unsure|^unknown|t know of any|^none that i am aware of|^n/a' # lower case at start of text
none.your = sum(str_detect(string=tolower(other.inst$your), none.text))
none.inst = sum(str_detect(string=tolower(other.inst$your.institute), none.text))
```
`r none.your` researchers said `None`, `Unknown` or `Unsure`.
```{r, results='asis'}
# remove none/unsure/etc from list
remove.none = other.you$your
index = str_detect(string=tolower(other.you$your), '^-$|^none$|^none.$|^none $|none that i am aware of|^unsure$|^unknown|t know of any|^n/a')
pandoc.list(remove.none[!index])
```
## Please share the policies or practices that your institution have already implemented to maximise research quality. If there are none then please write 'None'. All answers are anonymous.
`r none.inst` researchers said `None`, `Unknown` or `Unsure`.
```{r, results='asis'}
# remove none/unsure/etc from list
remove.none = other.inst$your.institute
index = str_detect(string=tolower(other.inst$your.institute), '^-$|^none$|^none.$|^none $|none that i am aware of|^unsure$|^unknown$|^n/a|^as above')
pandoc.list(remove.none[!index])
```
## What is your broad area of research?
```{r}
tab = table(data$field)
names(tab)[names(tab)==''] = 'Missing'
pander(tab)
```