Spaces:
Running
Running
Update ui.R
Browse files
ui.R
CHANGED
@@ -1,16 +1,147 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
# a categorical variable
|
4 |
-
vars <- setdiff(names(iris), "Species")
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
library(shiny)
|
2 |
+
library(ggplot2)
|
|
|
|
|
3 |
|
4 |
+
# Define UI for application that draws a histogram
|
5 |
+
shinyUI(fluidPage(
|
6 |
+
|
7 |
+
# Application title
|
8 |
+
titlePanel("glm distributions"),
|
9 |
+
|
10 |
+
h4("Select the glm distribution and then fixe
|
11 |
+
the parameters to obtain the probability distribution."),
|
12 |
+
|
13 |
+
# Sidebar with a slider input for number of bins
|
14 |
+
sidebarLayout(
|
15 |
+
sidebarPanel(
|
16 |
+
|
17 |
+
selectInput("Distribucion",
|
18 |
+
"What distribution?",
|
19 |
+
choices=c("Normal", "Gamma", "Inv. gaussian",
|
20 |
+
"Binomial",
|
21 |
+
"Poisson", "Negative binomial"),
|
22 |
+
selected="Normal"),
|
23 |
+
|
24 |
+
conditionalPanel(condition="input.Distribucion=='Normal'",
|
25 |
+
numericInput(inputId="mu_normal",
|
26 |
+
label=HTML("Select μ:"),
|
27 |
+
value="0.5",
|
28 |
+
step=0.01),
|
29 |
+
|
30 |
+
numericInput(inputId="sigma",
|
31 |
+
label=HTML("Select σ:"),
|
32 |
+
min=0.01,
|
33 |
+
value="1.2",
|
34 |
+
step=0.01),
|
35 |
+
|
36 |
+
numericInput(inputId="min_normal",
|
37 |
+
label="Select the minimun value for xlim",
|
38 |
+
value="-1", step=1),
|
39 |
+
numericInput(inputId="max_normal",
|
40 |
+
label="Select the maximum value for xlim",
|
41 |
+
value="3", step=1)
|
42 |
+
|
43 |
+
),
|
44 |
+
|
45 |
+
conditionalPanel(condition="input.Distribucion=='Gamma'",
|
46 |
+
numericInput(inputId="mu_gamma",
|
47 |
+
label=HTML("Select μ:"),
|
48 |
+
min=0.01,
|
49 |
+
value=1.5,
|
50 |
+
step=0.01),
|
51 |
+
|
52 |
+
numericInput(inputId="phi_gamma",
|
53 |
+
label=HTML("Select φ:"),
|
54 |
+
min=0.01,
|
55 |
+
value=0.3,
|
56 |
+
step=0.01),
|
57 |
+
|
58 |
+
numericInput(inputId="min_gamma",
|
59 |
+
label="Select the minimun value for xlim",
|
60 |
+
value="0.01", step=1),
|
61 |
+
numericInput(inputId="max_gamma",
|
62 |
+
label="Select the maximum value for xlim",
|
63 |
+
value="3", step=1)
|
64 |
+
|
65 |
+
),
|
66 |
+
|
67 |
+
conditionalPanel(condition="input.Distribucion=='Inv. gaussian'",
|
68 |
+
numericInput(inputId="mu_invgaus",
|
69 |
+
label=HTML("Select μ:"),
|
70 |
+
min=0.01,
|
71 |
+
value="1.5",
|
72 |
+
step=0.01),
|
73 |
+
|
74 |
+
numericInput(inputId="phi_invgaus",
|
75 |
+
#label=HTML("Select φ:"),
|
76 |
+
label="Select φ",
|
77 |
+
min=0.1,
|
78 |
+
value="1.2",
|
79 |
+
step=0.1),
|
80 |
+
|
81 |
+
numericInput(inputId="min_invgaus",
|
82 |
+
label="Select the minimun value for xlim",
|
83 |
+
value="0.01", step=1),
|
84 |
+
numericInput(inputId="max_invgaus",
|
85 |
+
label="Select the maximum value for xlim",
|
86 |
+
value="3", step=1)
|
87 |
+
|
88 |
+
),
|
89 |
+
|
90 |
+
conditionalPanel(condition="input.Distribucion=='Binomial'",
|
91 |
+
numericInput(inputId="mu_binom",
|
92 |
+
label=HTML("Select μ:"),
|
93 |
+
min=0.01,
|
94 |
+
max=0.99,
|
95 |
+
value=0.3,
|
96 |
+
step=0.01),
|
97 |
+
|
98 |
+
numericInput(inputId="m",
|
99 |
+
label=HTML("Select m the number of experiments"),
|
100 |
+
min=1,
|
101 |
+
value=7,
|
102 |
+
step=1)
|
103 |
+
),
|
104 |
+
|
105 |
+
conditionalPanel(condition="input.Distribucion=='Poisson'",
|
106 |
+
numericInput(inputId="mu_pois",
|
107 |
+
label=HTML("Select μ:"),
|
108 |
+
min=0.01,
|
109 |
+
value="2.7",
|
110 |
+
step=0.01),
|
111 |
+
|
112 |
+
numericInput(inputId="max_pois",
|
113 |
+
label="Select the maximum value for xlim",
|
114 |
+
value="15", step=1)
|
115 |
+
|
116 |
+
),
|
117 |
+
|
118 |
+
conditionalPanel(condition="input.Distribucion=='Negative binomial'",
|
119 |
+
numericInput(inputId="mu_negbin",
|
120 |
+
label=HTML("Select μ:"),
|
121 |
+
min=0.01,
|
122 |
+
value="2.7",
|
123 |
+
step=0.01),
|
124 |
+
|
125 |
+
numericInput(inputId="k",
|
126 |
+
label=HTML("Select k"),
|
127 |
+
min=0.01,
|
128 |
+
value="1.6",
|
129 |
+
step=0.01),
|
130 |
+
|
131 |
+
numericInput(inputId="max_negbin",
|
132 |
+
label="Select the maximum value for xlim",
|
133 |
+
value="15", step=1)
|
134 |
+
|
135 |
+
|
136 |
+
),
|
137 |
+
|
138 |
+
img(src="logo.png", height = 60, width = 140),
|
139 |
+
|
140 |
+
),
|
141 |
+
|
142 |
+
# Show a plot of the generated distribution
|
143 |
+
mainPanel(
|
144 |
+
plotOutput("distPlot", width = "400px")
|
145 |
+
)
|
146 |
+
)
|
147 |
+
))
|