forked from hcommenges/ExaminatR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
386 lines (363 loc) · 16 KB
/
ui.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
library(shiny)
shinyUI(fluidPage(theme = "darkGrey.css",
tags$head(tags$link(rel="shortcut icon", href="favicon.png"),
includeScript("www/analytics.js")),
# TITLE PANEL ----
titlePanel("ExaminatR : générateur automatique de sujets d'examen"),
sidebarLayout(
# SIDEBAR PANEL ----
sidebarPanel(
tags$strong("GUIDE D'UTILISATION"),
htmlOutput("citation"),
tags$hr(),
tags$strong("PRODUIRE LE DOCUMENT"),
radioButtons("docformat", "", c("pdf", "odt", "docx"),
inline = TRUE),
downloadButton("report")
),
# MAIN PANEL ----
mainPanel(
tags$hr(),
# Titre
tags$h4("Charger les données"),
tags$hr(),
# Description du sujet
checkboxInput("checkloadtab", "Charger le tableau (requis)", FALSE),
conditionalPanel(
condition = "input.checkloadtab == true",
checkboxInput("csvSettings", "Options du format CSV", FALSE),
conditionalPanel(
condition = "input.csvSettings == true",
radioButtons("sepcol", "Separateur de colonnes",
c(Virgule = ",",
Point_virgule = ";",
Tabulation = "\t"),
","),
radioButtons("sepdec", "Separateur décimal",
c(Point = ".",
Virgule = ","),
"."),
radioButtons("quote", "Guillemets",
c(None = "",
"Double Quote" = '"',
"Single Quote" = "'"),
'"')
),
fileInput("fileInput", "",
accept = c("text/csv",
"text/comma-separated-values,text/plain",
".csv"), multiple = FALSE),
selectInput("idtab",
"Variable identifiant",
choices = "",
selected = "",
multiple = FALSE,
width = "50%",
selectize = TRUE)
),
tags$hr(),
# Charger le shape
checkboxInput("checkloadshape", "Charger le fond de carte (optionnel)", FALSE),
conditionalPanel(
condition = "input.checkloadshape == true",
fileInput("shapeInput", "",
accept = c("application/zip",
"application/x-gzip",
".zip")),
selectInput("idshape",
"Variable identifiant",
choices = "",
selected = "",
multiple = FALSE,
width = "50%",
selectize = TRUE)),
tags$hr(),
tags$h4("Décrire le sujet et les données"),
tags$hr(),
# Description du sujet
checkboxInput("checkdescrsujet", "Description du sujet", FALSE),
conditionalPanel(
condition = "input.checkdescrsujet == true",
textInput("nomepreuve", "Entrer le nom de l'épreuve", value = "", width = "100%"),
textInput("nomsujet", "Entrer le sujet de l'épreuve", value = "", width = "100%"),
textInput("descrsujet", "Entrer la description du sujet", value = "", width = "100%")
),
tags$hr(),
# Description des données
checkboxInput("checkdescrdonnees", "Description des données", FALSE),
conditionalPanel(
condition = "input.checkdescrdonnees == true",
selectInput("vartot",
"Choisir les variables à décrire",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE,
width = "100%"),
textInput("descrdonnees", "Entrer la description des variables (séparées par des virgules)", value = "", width = "100%")
),
tags$hr(),
# Titre
tags$h4("Choisir les analyses à effectuer"),
tags$hr(),
# Analyse univariée
checkboxInput("checkunivar", "Analyse univariée", FALSE),
conditionalPanel(
condition = "input.checkunivar == true",
selectInput("varuni",
"Choisir les variables à utiliser",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE)
),
tags$hr(),
# Analyse bivariée
checkboxInput("checkbivar", "Analyse bivariée", FALSE),
conditionalPanel(
condition = "input.checkbivar == true",
fluidRow(
column(4,
checkboxInput("checkqualiquali", "Contingence (quali-quali)", FALSE),
selectInput("varqualiquali",
"Choisir les variables (Y puis X)",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE)),
column(4,
checkboxInput("checkquantiquanti", "Régression (quanti-quanti)", FALSE),
selectInput("varquantiquanti",
"Choisir les variables (Y puis X)",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE)),
column(4,
checkboxInput("checkqualiquanti", "ANOVA (quali-quanti)", FALSE),
selectInput("varqualiquanti",
"Choisir les variables (Y puis X)",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE)))
),
tags$hr(),
# Analyse trivariée
checkboxInput("checktrivar", "Analyse trivariée", FALSE),
conditionalPanel(
condition = "input.checktrivar == true",
fluidRow(
column(4,
checkboxInput("checkregress2", "Régression (X1 et X2 quanti)", FALSE),
selectInput("varregress2",
"Choisir les variables (Y, X1, X2)",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE),
radioButtons("interactregress2",
label = "Interaction X1-X2",
choices = c("Sans interaction" = FALSE, "Avec interaction" = TRUE),
selected = FALSE,
inline = TRUE)),
column(4,
checkboxInput("checkanova2", "ANOVA (X1 et X2 quali)", FALSE),
selectInput("varanova2",
"Choisir les variables (Y, X1, X2)",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE),
radioButtons("interactanova2",
label = "Interaction X1-X2",
choices = c("Sans interaction" = FALSE, "Avec interaction" = TRUE),
selected = FALSE,
inline = TRUE)),
column(4,
checkboxInput("checkancova", "ANCOVA (X1 quanti, X2 quali)", FALSE),
selectInput("varancova",
"Choisir les variables (Y, X1, X2)",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE),
radioButtons("interactancova",
label = "Interaction X1-X2",
choices = c("Sans interaction" = FALSE, "Avec interaction" = TRUE),
selected = FALSE,
inline = TRUE)))
),
tags$hr(),
# Analyse en composantes principales
checkboxInput("checkacp", "Analyse en composantes principales", FALSE),
conditionalPanel(
condition = "input.checkacp == true",
fluidRow(
column(12,
selectInput("varacp",
"Choisir les variables de l'analyse (n quanti)",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE,
width = "100%"),
radioButtons("axisacp",
label = "Nombre d'axes à conserver",
choices = c("2 axes" = 2, "3 axes" = 3, "4 axes" = 4),
selected = 2,
inline = TRUE),
radioButtons("printlabel",
label = "Etiqueter les observations",
choices = c("Non (affichage des points)" = FALSE, "Oui (affichage des identifiants)" = TRUE),
selected = FALSE,
inline = TRUE))
)),
tags$hr(),
# Classification
checkboxInput("checkcah", "Classification", FALSE),
conditionalPanel(
condition = "input.checkcah == true",
fluidRow(
column(12,
selectInput("varcah",
"Choisir les variables de l'analyse (n quanti)",
choices = "",
selected = "",
multiple = TRUE,
selectize = TRUE,
width = "100%"),
sliderInput("nbclus",
label = "Nombre de classes",
min = 2,
max = 12,
value = 2,
step = 1))
)),
tags$hr(),
# Cartographie
checkboxInput("checkcarto", "Cartographie", FALSE),
conditionalPanel(
condition = "input.checkcarto == true",
checkboxInput("checkcartovar", "Cartographier des variables du tableau", FALSE),
conditionalPanel(
condition = "input.checkcartovar == true",
fluidRow(
column(4,
selectInput("varcarto1",
"Variable",
choices = "",
selected = "",
multiple = FALSE,
selectize = TRUE),
selectInput("varcarto2",
"Variable",
choices = "",
selected = "",
multiple = FALSE,
selectize = TRUE)),
column(4,
selectInput("discret1",
"Discrétisation",
choices = c("Quantiles" = "quantile",
"Seuils naturels" = "fisher-jenks"),
selected = "",
multiple = FALSE,
selectize = TRUE),
selectInput("discret2",
"Discrétisation",
choices = c("Quantiles" = "quantile",
"Seuils naturels" = "fisher-jenks"),
selected = "",
multiple = FALSE,
selectize = TRUE)),
column(4,
numericInput("nbcl1",
label = "Nombre de classes",
min = 2,
max = 12,
value = 4,
step = 1),
numericInput("nbcl2",
label = "Nombre de classes",
min = 2,
max = 12,
value = 4,
step = 1)
))
),
tags$hr(),
checkboxInput("checkcartoana", "Cartographier des résultats d'analyse", FALSE),
conditionalPanel(
condition = "input.checkcartoana == true",
fluidRow(
column(4,
selectInput("varcarto3",
"Résultats d'analyse",
choices = c("ø" = "ø",
"Régression (Y~X1)" = "reg1",
"Régression (Y~X1+X2)" = "reg2",
"Coordonnées factorielles (ACP)" = "acp",
"Classes (CAH)" = "cah"),
selected = "",
multiple = FALSE,
selectize = TRUE),
selectInput("varcarto4",
"Résultats d'analyse",
choices = c("ø" = "ø",
"Régression (Y~X1)" = "reg1",
"Régression (Y~X1+X2)" = "reg2",
"Coordonnées factorielles (ACP)" = "acp",
"Classes (CAH)" = "cah"),
selected = "",
multiple = FALSE,
selectize = TRUE)),
column(4,
numericInput("nbcl3",
label = "Nombre de classes",
min = 2,
max = 12,
value = 4,
step = 1),
numericInput("nbcl4",
label = "Nombre de classes",
min = 2,
max = 12,
value = 4,
step = 1))
))
),
tags$hr(),
checkboxInput("checkdistrib", "Statistiques de test (F, T, Chi2)", FALSE),
conditionalPanel(
condition = "input.checkdistrib == true",
checkboxInput("checkdistribchi", "Distributions de la statistique Chi2", FALSE),
conditionalPanel(
condition = "input.checkdistribchi == true",
fluidRow(
column(6, numericInput("chidf", label = "Degrés de liberté", value = 4, min = 1, max = 100, step = 1)),
column(6, numericInput("chialpha", label = "Seuil alpha", value = 0.05, min = 0.01, max = 0.99, step = 0.01))
)
),
checkboxInput("checkdistribt", "Distributions de la statistique T", FALSE),
conditionalPanel(
condition = "input.checkdistribt == true",
fluidRow(
column(6, numericInput("tdf", label = "Degrés de liberté", value = 30, min = 1, max = 1000, step = 1)),
column(6, numericInput("talpha", label = "Seuil alpha", value = 0.05, min = 0.01, max = 0.99, step = 0.01))
)
),
checkboxInput("checkdistribf", "Distributions de la statistique F", FALSE),
conditionalPanel(
condition = "input.checkdistribf == true",
fluidRow(
column(4, numericInput("fdf1", label = "Degrés de liberté (1)", value = 5, min = 1, max = 100, step = 1)),
column(4, numericInput("fdf2", label = "Degrés de liberté (2)", value = 30, min = 1, max = 1000, step = 1)),
column(4, numericInput("falpha", label = "Seuil alpha", value = 0.05, min = 0.01, max = 0.99, step = 0.01))
)
)
),
tags$hr()
)
)
))