-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgc_tables.R
80 lines (66 loc) · 3.23 KB
/
gc_tables.R
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
# Extract select tables from the gotham culture report.
# Author: Adam
# Version: 2023-05-05
# Packages
packs <- c("tidyverse", "tabulizer", "ggplot2")
lapply(packs, require, character.only = TRUE)
# Parameters
# Not Applicable
# ============================================================================
# Q 37_4: I feel valued and supported by Division Leadership --------------
#extract table
leadership_value_raw <-
extract_areas("H:\\My Documents\\DLT\\GothamSurvey\\SPF Report 31 Mar 2023.pdf", pages = 38:39, "data.frame")
leadership_value_raw
leadership_value0 <- rbind(leadership_value_raw[[1]], leadership_value_raw[[2]])
#make a clean work groups vector
(multiple_rows <- leadership_value0[, 1][leadership_value0[, 2] == ""])
leadership_value0[, 1]
(workgroups <- leadership_value0[, 1][leadership_value0[, 2] != ""])
workgroups[3] <- paste(workgroups[3], multiple_rows[1], multiple_rows[2])
workgroups[4] <- paste(workgroups[4], multiple_rows[3], multiple_rows[4])
workgroups[7] <- paste(workgroups[7], multiple_rows[5])
workgroups[11] <- paste(workgroups[11], multiple_rows[6])
workgroups[19] <- paste(workgroups[19], multiple_rows[7])
workgroups[20] <- paste(workgroups[20], multiple_rows[8])
workgroups[21] <- paste(workgroups[21], multiple_rows[9], multiple_rows[10])
workgroups[22] <- paste(workgroups[22], multiple_rows[11])
#categories for agree/disagree questions
agree_cats <- c("Strongly Disagree", "Disagree", "Somewhat Disagree", "Neutral", "Somewhat Agree", "Agree", "Strongly Agree")
#Build and save table
leadership_value <- leadership_value0[leadership_value0[, 2] != "", ]
leadership_value[, 1] <- workgroups
colnames(leadership_value) <- c("Workgroup", agree_cats)
saveRDS(leadership_value, ".\\gCtables\\leadership_value.rds")
# Q 15: Decision makers explain rationale behind decisions --------------
#extract table
rationale_raw <-
extract_areas("H:\\My Documents\\DLT\\GothamSurvey\\SPF Report 31 Mar 2023.pdf", pages = 16:17, "data.frame")
rationale_raw
rationale0 <- rbind(rationale_raw[[1]], rationale_raw[[2]][, -2])
#Build and save table
rationale <- rationale0[rationale0[, 2] != "", ]
rationale[, 1] <- workgroups
colnames(rationale) <- c("Workgroup", agree_cats)
saveRDS(rationale, ".\\gCtables\\rationale.rds")
# Q 33: ADF&G provides me with opportunities to develop my skills and prepare me for advancement --------------
#extract table
skills_raw <-
extract_areas("H:\\My Documents\\DLT\\GothamSurvey\\SPF Report 31 Mar 2023.pdf", pages = 32:33, "data.frame")
skills_raw
skills0 <- rbind(skills_raw[[1]], skills_raw[[2]][, -c(2:3)])
#Build and save table
skills <- skills0[skills0[, 2] != "", ]
skills[, 1] <- workgroups
colnames(skills) <- c("Workgroup", agree_cats)
saveRDS(skills, ".\\gCtables\\skills.rds")
# Q 51: I generally have the flexibility I need with my work schedule --------------
#extract table
flexibility_raw <- extract_areas("H:\\My Documents\\DLT\\GothamSurvey\\SPF Report 31 Mar 2023.pdf", pages = 56:57, "data.frame")
flexibility_raw
flexibility0 <- rbind(flexibility_raw[[1]], flexibility_raw[[2]])
#Build and save table
flexibility <- flexibility0[flexibility0[, 2] != "", ]
flexibility[, 1] <- workgroups
colnames(flexibility) <- c("Workgroup", agree_cats)
saveRDS(flexibility, ".\\gCtables\\flexibility.rds")