Newer
Older
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
library(shiny)
shinyUI(pageWithSidebar(
headerPanel("Théoreme central limite"),
conditionalPanel(
condition = "input.visM == false",
sidebarPanel(
tags$head(
tags$style(type="text/css", "label { display: inline; }"),
tags$style(type="text/css", '.checkbox input[type="checkbox"],.radio input[type="radio"] { float: none; }'),
tags$style(type="text/css", ".jslider { max-width: 250px; }"),
tags$style(type='text/css', ".well { max-width: 300px; }"),#class of the from inside sidebarPanel
tags$style(type='text/css', ".span4 { max-width: 400px; }"),#span4 is the span of sidebarPanel (span8 is for the mainPanel)
# tags$style(type='text/css', "#complementinfos { width: 150px; }"),
# tags$style(type='text/css', "#CVk { width: 150px; }"),
# tags$style(type='text/css', "#mx, #sx, #df1, #df2, #m1, #sd1, #m2, #sd2 { width: 30px; }"),
# tags$style(type='text/css', "select#display { width: 150px; }"),
# tags$style(type='text/css', "#mainInputs {margin : 0px 0px 4px 0px; }"),
# tags$style(type='text/css', "input[type=number] {width:50px;}"),
tags$script(type="text/javascript",src="js/scripts.js")
)
,h5(HTML("Paramètres de l'échantillonnage"))
,sliderInput("n",HTML("Nombre d'individus par échantillon : n"),min = 5,max = 200,value =100, step=5)
,sliderInput("ns",HTML("Nombre d'échantillons prélevés"), min = 1, max = 200, value = 1)
,h5(HTML("Paramètres de la distribution théorique"))
,selectInput("dist", " ",
choices = c ("Normale" = "DN"
,"Uniforme discrète" = "DUD"
,"Uniforme continue" = "DU"
,"Exponentielle" = "DE"
,"Chi-carree" = "DC"
,"Fisher" = "DF"
,"Bimodale"= "DB"
,"Binomiale" = "DBin")), #,"Log-Normale" = "DLN"
#Normale
conditionalPanel(condition = "input.dist == 'DN'"
,numericInput('mx', HTML("μ : "), min=5, max=15, value=10, step=0.1)
,numericInput('sx', HTML("σ : "), min=0.5, max=3.5, value=2, step=0.1)
#,HTML("μ"),sliderInput("mx","" , min = 5, max = 15, value = 10, step = 0.1)
#,HTML("σ"),sliderInput("sx","", min = 0.5, max = 3.5, value = 2, step = 0.1)
)
#Binomiale
,conditionalPanel(condition = "input.dist == 'DBin'"
,p(HTML("n est défini par le 1er slider des paramètres de l'échantillonnage"))
,numericInput('p', HTML("p : "), min=0, max=1, value=0.5, step=0.01)
)
#Log-Normale
#,conditionalPanel(condition = "input.dist == 'DLN'"
# ,HTML("μ"),sliderInput("lmx","" , min = 5, max = 15, value = 10, step = 0.1)
# ,HTML("σ"),sliderInput("lsx","", min = 0.5, max = 3.5, value = 2, step = 0.1)
# )
#Uniforme discrète
,conditionalPanel(condition = "input.dist == 'DUD'"
,sliderInput("RUD", "", min = 1, max = 12, value = c(1,6))
)
#Uniforme continue
,conditionalPanel(condition = "input.dist == 'DU'"
,p(HTML("θ<sub>1</sub> est fixé à 0"))
,numericInput('b', HTML("θ<sub>2</sub> : "), min=1, max=20, value=20, step=0.1)
#,HTML("θ<sub>2</sub>") ,sliderInput("b", "", min = 1, max = 20, value = 20, step = 0.1)
)
#Exponentielle
,conditionalPanel(condition = "input.dist == 'DE'"
,numericInput('Lambda', HTML("λ : "), min=0.1, max=10, value=2, step=0.1)
#,HTML("λ"),sliderInput("Lambda", "", min = 0.1, max = 10, value = 2, step = 0.1)
)
#Chi-carrée
,conditionalPanel(condition = "input.dist == 'DC'"
,numericInput('df', HTML("ν : "), min=1, max=20, value=5, step=1)
#,HTML("ν"),sliderInput("df", "", min = 1, max = 20, value = 5, step = 1)
)
#Fisher
,conditionalPanel(condition = "input.dist == 'DF'"
,numericInput('df1', HTML("ν<sub>1</sub> : "), min=1, max=50, value=5, step=1)
,numericInput('df2', HTML("ν<sub>2</sub> : "), min=1, max=100, value=20, step=1)
#,HTML("ν<sub>1</sub>"),sliderInput("df1", "", min = 1, max = 50, value = 5, step = 1)
#,HTML("ν<sub>2</sub>"),sliderInput("df2", "", min = 1, max = 100, value = 20, step = 1)
)
#Bimodale
,conditionalPanel(condition="input.dist=='DB'"
,numericInput('m1', HTML("μ<sub>1</sub> : "), min=8, max=12, value=8, step=0.1)
,numericInput('sd1', HTML("σ<sub>1</sub> : "), min=1, max=2, value=1.5, step=0.01)
,br()
,numericInput('m2', HTML("μ<sub>2</sub> : "), min=1, max=5, value=4, step=0.1)
,numericInput('sd2', HTML("σ<sub>2</sub> : "), min=1, max=2, value=1.1, step=0.01)
#,HTML("μ<sub>1</sub>"),sliderInput("m1", "", min=8, max=12, value=8, step=0.1)
#,HTML("μ<sub>2</sub>"),sliderInput("m2", "", min=1, max=5, value=4, step=0.1)
#,HTML("σ<sub>1</sub>"),sliderInput("sd1", "", min=1, max=2, value=1.5, step=0.01)
#,HTML("σ<sub>2</sub>"),sliderInput("sd2", "", min=1, max=2, value=1.1, step=0.01)
)
,h5("Paramètres graphiques"),
HTML ("Afficher :"),
br(),
checkboxInput("empPl",HTML("Statistiques descriptives"),TRUE),
br(),
checkboxInput("showreality",HTML("Distribution théorique d'origine"),TRUE),
br(),
conditionalPanel(condition = "input.dist != 'DBin'",
checkboxInput("showMdensity", HTML("Densité normale sur l'histogramme des moyennes"), FALSE)
,br()),
conditionalPanel(condition = "input.dist == 'DBin'",
checkboxInput("showNdensity", HTML("Densité normale sur les histogrammes"), FALSE)
,br()),
br(),
selectInput("range", HTML("Choix de l'étendue en abscisse"),
choices = c ("Spécifique au graphe" = "DifRange"
,"Identique pour tous les graphes" = "SameRange"
)),
br(),
#Normale
conditionalPanel(condition = "input.dist == 'DN'&& input.range =='SameRange'"
,sliderInput("rangeXdn", "",
min = -10, max = 40, value = c(0,20))),
conditionalPanel(condition = "input.dist == 'DN' && input.range =='DifRange'"
,sliderInput("rangeObsdn", "Observations",
min = -10, max = 40, value = c(0,20))
,sliderInput("rangeXbardn", "Moyennes",
min = 0, max = 20, value = c(8,12))),
#Binomiale
conditionalPanel(condition = "input.dist == 'DBin'&& input.range =='SameRange'"
,sliderInput("rangeXdbin", "",
min = 0, max = 200, value = c(0,100))),
conditionalPanel(condition = "input.dist == 'DBin' && input.range =='DifRange'"
,sliderInput("rangeObsdbin", "Observations",
min = 0, max = 200, value = c(0,100))
,sliderInput("rangeXbardbin", "Moyennes",
min = 0, max = 1, value = c(0,1))),
#Log-normale
#conditionalPanel(condition = "input.dist == 'DLN'&& input.range =='SameRange'"
# ,sliderInput("rangeXdln", "",
# min = -10, max = 40, value = c(1,20))),
#Uniforme discrète
conditionalPanel(condition = "input.dist == 'DUD'&& input.range =='SameRange'"
,sliderInput("rangeXdud", HTML("Choix de l'étendue en abscisse"),
min = 0, max = 12, value = c(1,6))),
conditionalPanel(condition = "input.dist == 'DUD' && input.range =='DifRange'"
,sliderInput("rangeObsdud", "Observations",
min = 0, max = 12, value = c(1,6))
,sliderInput("rangeXbardud", "Moyennes",
min = 0, max = 12, value = c(1,6))),
#Uniforme continue
conditionalPanel(condition = "input.dist == 'DU'&& input.range =='SameRange'"
,sliderInput("rangeXdu", HTML("Choix de l'étendue en abscisse"),
min = -5, max = 25, value = c(-1,21))),
conditionalPanel(condition = "input.dist == 'DU' && input.range =='DifRange'"
,sliderInput("rangeObsdu", "Observations",
min = -5, max = 25, value = c(-1,21))
,sliderInput("rangeXbardu", "Moyennes",
min = 0, max = 20, value = c(7,13))),
#Exponentielle
conditionalPanel(condition = "input.dist == 'DE'&& input.range =='SameRange'"
,sliderInput("rangeXde", HTML("Choix de l'étendue en abscisse"),
min = -5, max = 20, value = c(0,5))),
conditionalPanel(condition = "input.dist == 'DE' && input.range =='DifRange'"
,sliderInput("rangeObsde", "Observations",
min = -5, max = 20, value = c(0,5))
,sliderInput("rangeXbarde", "Moyennes",
min = -1, max = 5, value = c(0,1))),
#Chi-carrée
conditionalPanel(condition = "input.dist == 'DC'&& input.range =='SameRange'"
,sliderInput("rangeXdc", HTML("Choix de l'étendue en abscisse"),
min = -5, max = 60, value = c(0,20))),
conditionalPanel(condition = "input.dist == 'DC' && input.range =='DifRange'"
,sliderInput("rangeObsdc", "Observations",
min = -5, max = 60, value = c(0,30))
,sliderInput("rangeXbardc", "Moyennes",
min = 0, max = 25, value = c(3,7))),
#Fisher
conditionalPanel(condition = "input.dist == 'DF'&& input.range =='SameRange'"
,sliderInput("rangeXdf", HTML("Choix de l'étendue en abscisse"),
min = -5, max = 10, value = c(0,5))),
conditionalPanel(condition = "input.dist == 'DF' && input.range =='DifRange'"
,sliderInput("rangeObsdf", "Observations",
min = -5, max = 50, value = c(0,10))
,sliderInput("rangeXbardf", "Moyennes",
min = 0, max = 5, value = c(0,2))),
#Bimodale
conditionalPanel(condition="input.dist=='DB'&& input.range =='SameRange'"
,sliderInput("rangeXdb", HTML("Choix de l'étendue en abscisse"),
min=-20, max=40, value=c(0,15))),
conditionalPanel(condition = "input.dist == 'DB' && input.range =='DifRange'"
,sliderInput("rangeObsdb", "Observations",
min=-20, max=40, value=c(0,15))
,sliderInput("rangeXbardb", "Moyennes",
min=-0, max=10, value=c(4,8))),
selectInput("display", "Display :",
list("Defaut" = "default",
"1024x768" = "1024",
"800x600" = "800")),
HTML('<hr style="border:1px solid #ccc;"/>'),
HTML('<a rel="license" href="http://creativecommons.org/licenses/by/2.0/be/"><img alt="Licence Creative Commons" style="border-width:0" src="img/cc_by_80x15.png" /></a> Cette oeuvre de <span xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName">Statistical eLearning Tools</span> est mise à disposition selon les termes de la <a rel="license" href="http://creativecommons.org/licenses/by/2.0/be/">licence Creative Commons Attribution 2.0 Belgique</a>.'),
HTML('<p>Code source disponible sur <a href="https://github.com/uclouvain-selt/shiny/tree/master/tcl" target="_blank">Github</a></p><p><a href="http://www.uclouvain.be/" target="_blank" title="Copyright - Université catholique de Louvain"><img alt="Copyright - Université catholique de Louvain" style="border-width:0" src="img/UCL_2018.png" width=100 /></a></p>')
)
),
mainPanel(
HTML("<div id='mainInputs'>"),
actionButton("takesample","Echantillonner"),actionButton("reset","Reset"),checkboxInput("visM",HTML("Plein écran"),FALSE),
HTML("</div>"),
plotOutput("doublePlot", height = "auto")
)
))