Spaces:
Sleeping
Sleeping
FreddyHernandez
commited on
Commit
•
4ad3740
1
Parent(s):
b680728
Update server.R
Browse files
server.R
CHANGED
@@ -1,18 +1,15 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
#
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
grid()
|
17 |
-
})
|
18 |
-
})
|
|
|
1 |
+
library(shiny)
|
2 |
+
library(gamlss.dist)
|
3 |
+
|
4 |
+
shinyServer(function(input, output) {
|
5 |
+
output$distPlot <- renderPlot({
|
6 |
+
# generate values of the ZIP distribution based on input$mu from ui.R
|
7 |
+
x <- seq(0, input$xmax, 1)
|
8 |
+
y <- dZIP(x, mu=input$mu, sigma=input$Prop)
|
9 |
+
# draw the histogram with the specified number of bins
|
10 |
+
barplot(y, main='Diagrama de barras para las probabilidades',
|
11 |
+
xlab='x', ylab=expression(P(X==x)), las=1, col='deepskyblue3',
|
12 |
+
names.arg = x, ylim=c(0, 1))
|
13 |
+
grid()
|
14 |
+
})
|
15 |
+
})
|
|
|
|
|
|