-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbar_singlecategory.R
42 lines (39 loc) · 1.47 KB
/
bar_singlecategory.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
# Variable required from basic_dataprep
# myvarstubs master list of all category variables
# myvarstub the category variable to use in this script as index of master list
# Locus of Control Graph
png(file=paste0("output/",myvarstub,"_locus.png"),width=800,height=400,res=150)
locusoptions = c(
sum(mysurveys[,paste0(myvarstub,'_locus_options___1')]),
sum(mysurveys[,paste0(myvarstub,'_locus_options___2')]),
sum(mysurveys[,paste0(myvarstub,'_locus_options___3')]),
sum(mysurveys[,paste0(myvarstub,'_locus_options___4')])
)
names(locusoptions) <- c(
"Informatics","Research Office",
"IT Department/CIO", "Other"
)
par(mar=c(2,9,1,1))
barplot(locusoptions, horiz=TRUE, las=1,
main=NULL,
xlim=c(0,maxbarlocus),col="black",border="white")
dev.off()
print(paste0("Made locus control ",myvarstub))
# Sustainability Considerations
png(file=paste0("output/",myvarstub,"_sust.png"),width=800,height=400,res=150)
sustoptions = c(
sum(mysurveys[,paste0(myvarstub,'_sust_options___1')]),
sum(mysurveys[,paste0(myvarstub,'_sust_options___2')]),
sum(mysurveys[,paste0(myvarstub,'_sust_options___3')]),
sum(mysurveys[,paste0(myvarstub,'_sust_options___4')])
)
names(sustoptions) <- c(
"Institutional infrastructure","Fees for service model",
"Sustained grant support", "Other"
)
par(mar=c(2,11,1,1))
barplot(sustoptions, horiz=TRUE, las=1,
main=NULL,
xlim=c(0,maxbarlocus),col="black",border="white")
dev.off()
print(paste0("Made sustainability ",myvarstub))