-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodule_nine.R
184 lines (147 loc) · 4.82 KB
/
module_nine.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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Including the core functionality
source("module_nine_core.R")
## ======================= UTILITY LIST ==========================
module_nine_list<-c( "Histograms",
"Line Graph",
"Bar Graph",
"Pie Chart",
"Scatter plot",
"Box-plot",
"q-q plot",
"Stem-leaf plot",
"Pareto Chart"
)
## ========================= I/O FUNCTIONS ==============================
## ========================= Histogram & Bar plot ==============================
my_hist_input<-function(){
tagList(
textInput('my_hist_input_dataOne', 'Enter data set to be plotted ( comma delimited )', "1,2,3,4,5,1,2,3,3,3,5")
)
}
my_hist_output<-function(){
tagList(
renderPlot({
mydata<- as.numeric(unlist(strsplit(input$my_hist_input_dataOne,",")))
my_hist(mydata)
})
)
}
my_barplot_input<-function(){
tagList(
textInput('my_barplot_input_dataOne', 'Enter data set to be plotted ( comma delimited )', "1,2,3,4,5,1,2,3,3,3,5")
)
}
my_barplot_output<-function(){
tagList(
renderPlot({
mydata<- as.numeric(unlist(strsplit(input$my_barplot_input_dataOne,",")))
my_barplot(mydata)
})
)
}
## ========================= Line Chart ==============================
my_linegraph_input<-function(){
tagList(
textInput('my_linegraph_input_dataOne', 'Enter data set 1 ', "5,6,1,1,2,3"),
textInput('my_linegraph_input_dataTwo', 'Enter data set 2 (if any)', "2,3"),
textInput('my_linegraph_input_dataThree', 'Enter data set 3 (if any)', "0")
)
}
my_linegraph_output<-function(){
tagList(
renderPlot({
mydata1<- as.numeric(unlist(strsplit(input$my_linegraph_input_dataOne,",")))
mydata2<- as.numeric(unlist(strsplit(input$my_linegraph_input_dataTwo,",")))
mydata3<- as.numeric(unlist(strsplit(input$my_linegraph_input_dataThree,",")))
my_linegraph(mydata1,mydata2,mydata3)
})
)
}
## ========================= Pie Chart ==============================
my_pie_input<-function(){
tagList(
textInput('my_pie_input_dataOne', 'Enter data set to be plotted ( comma delimited )', "1,2,3,4,5,1,2,3,3,3,5")
)
}
my_pie_output<-function(){
tagList(
renderPlot({
mydata<- as.numeric(unlist(strsplit(input$my_pie_input_dataOne,",")))
my_pie(mydata)
})
)
}
## ========================= Scatter, BOX, qq plot ==============================
my_scatter_input<-function(){
tagList(
textInput('my_scatter_input_dataOne', 'Enter data set to be plotted across x axis', "1,2,3,4,5,6,7,8,9,10,11"),
textInput('my_scatter_input_dataTwo', 'Enter data set to be plotted across y axis', "3,4,7,9,10,14,15,18,19,11,13")
)
}
my_scatter_output<-function(){
tagList(
renderPlot({
x<- as.numeric(unlist(strsplit(input$my_scatter_input_dataOne,",")))
y<- as.numeric(unlist(strsplit(input$my_scatter_input_dataTwo,",")))
my_scatter(x,y)
})
)
}
my_boxplot_input<-function(){
tagList(
textInput('my_boxplot_input_dataOne', 'Enter data set to be plotted across x axis', "1,2,3,4,5,6,7,8,9,10,11"),
textInput('my_boxplot_input_dataTwo', 'Enter data set to be plotted across y axis', "3,4,7,9,10,14,15,18,19,11,13")
)
}
my_boxplot_output<-function(){
tagList(
renderPlot({
x<- as.numeric(unlist(strsplit(input$my_boxplot_input_dataOne,",")))
y<- as.numeric(unlist(strsplit(input$my_boxplot_input_dataTwo,",")))
my_boxplot(x,y)
})
)
}
my_qplot_input<-function(){
tagList(
textInput('my_qplot_input_dataOne', 'Enter data set to be plotted across x axis', "1,2,3,4,5,6,7,8,9,10,11"),
textInput('my_qplot_input_dataTwo', 'Enter data set to be plotted across y axis', "3,4,7,9,10,14,15,18,19,11,13")
)
}
my_qplot_output<-function(){
tagList(
renderPlot({
x<- as.numeric(unlist(strsplit(input$my_qplot_input_dataOne,",")))
y<- as.numeric(unlist(strsplit(input$my_qplot_input_dataTwo,",")))
my_qplot(x,y)
})
)
}
## ========================= Stem Leaf ==============================
my_stem_input<-function(){
tagList(
textInput('my_stem_input_dataOne', 'Enter data set to be plotted ( comma delimited )', "1,2,3,5,5,4,1,1,1")
)
}
my_stem_output<-function(){
tagList(
renderPrint({
mydata<- as.numeric(unlist(strsplit(input$my_stem_input_dataOne,",")))
cat(my_stem(mydata))
})
)
}
## ========================= Pareto Chart ==============================
my_pareto_chart_input<-function(){
tagList(
textInput('my_pareto_chart_input_dataOne', 'Enter data set to be plotted ( comma delimited )', "5,6,1,1,2,3")
)
}
my_pareto_chart_output<-function(){
tagList(
renderPlot({
mydata<- as.numeric(unlist(strsplit(input$my_pareto_chart_input_dataOne,",")))
my_pareto_chart(mydata)
})
)
}