-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.R
More file actions
21 lines (15 loc) · 784 Bytes
/
check.R
File metadata and controls
21 lines (15 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
library(readxl)
library(dplyr)
library(tidyr)
q <- read_excel("Raw data.xlsx")
q <- q %>% select(`Response ID`,affiliation,`Provide input as to how you believe the mission statement could be improved.`,
`Provide input as to how you believe the vision statement could be improved.`,
`Provide input as to how you believe the core values could be improved.`) %>%
setNames(c('Id','affiliation','mission','vision','values'))
tmp <- q%>% gather( "Topic",'comment',3:5,na.rm = TRUE)
#breakdown by respondents - across all three items
tmp %>% distinct(`Response ID`,.keep_all = TRUE) %>% count(affiliation)
#breakdown by respondents and by each item
by_q <- tmp %>%
group_by(Topic, affiliation) %>% summarise(n=n()) %>%
spread(Topic,n)