Spaces:
Sleeping
Sleeping
FreddyHernandez
commited on
Commit
路
b27d0ee
1
Parent(s):
61da889
Upload 2 files
Browse files
server.R
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
library(shiny)
|
2 |
+
|
3 |
+
shinyServer(function(input, output)
|
4 |
+
{
|
5 |
+
|
6 |
+
output$grafico1 <- renderPlot({
|
7 |
+
curve(dcauchy(x, input$mu, input$sigma),
|
8 |
+
from=input$mu-input$x.max,
|
9 |
+
to=input$mu+input$x.max, ylab="Densidad",
|
10 |
+
las=1, lwd=3, col="deepskyblue3")
|
11 |
+
grid()
|
12 |
+
})
|
13 |
+
|
14 |
+
output$med_var <- renderText({
|
15 |
+
mediana <- input$mu
|
16 |
+
entropia <- log(4*pi*input$sigma)
|
17 |
+
paste(c("Para esta configuraci贸n Mediana =", mediana,
|
18 |
+
"con Entropia =", entropia))
|
19 |
+
})
|
20 |
+
|
21 |
+
})
|
ui.R
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
library(shiny)
|
2 |
+
|
3 |
+
shinyUI(fluidPage(
|
4 |
+
|
5 |
+
# Application title
|
6 |
+
titlePanel("Distribuci贸n Cauchy"),
|
7 |
+
|
8 |
+
sidebarLayout(
|
9 |
+
sidebarPanel(
|
10 |
+
p("Modifique los par谩metros y
|
11 |
+
observe lo que sucede con la densidad."),
|
12 |
+
br(),
|
13 |
+
numericInput(inputId = "mu",
|
14 |
+
label = HTML("Ingrese el valor de μ:"),
|
15 |
+
min = -10,
|
16 |
+
value = 0,
|
17 |
+
step= 0.1),
|
18 |
+
sliderInput(inputId = "sigma",
|
19 |
+
label = HTML("Ingrese el valor de σ:"),
|
20 |
+
min = 0.01,
|
21 |
+
max = 10,
|
22 |
+
value = 1,
|
23 |
+
step= 0.01, animate = TRUE),
|
24 |
+
tags$br(),
|
25 |
+
sliderInput(inputId = "x.max",
|
26 |
+
label = "Ingrese el m谩ximo valor de x para mostrar
|
27 |
+
alrededoral par谩metro de localizaci贸n:",
|
28 |
+
min = 0.01,
|
29 |
+
max = 100,
|
30 |
+
value = 5,
|
31 |
+
step = 0.1),
|
32 |
+
br(),
|
33 |
+
p("App creada por el Semillero de R de la Universidad Nacional de Colombia:"),
|
34 |
+
tags$a(href="https://srunal.github.io", "https://srunal.github.io")
|
35 |
+
),
|
36 |
+
|
37 |
+
# Show a plot of the generated distribution
|
38 |
+
mainPanel(
|
39 |
+
h3("Densidad para la distribuci贸n Cauchy", align = "center"),
|
40 |
+
plotOutput("grafico1"),
|
41 |
+
verbatimTextOutput('med_var')
|
42 |
+
)
|
43 |
+
)
|
44 |
+
))
|