File size: 516 Bytes
9da1728
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
library(shiny)

shinyServer(function(input, output) 
{
  
  output$grafico1 <- renderPlot({
    curve(dgamma(x, shape=input$shape, scale=input$scale),
          from=0, to=input$x.max, ylab="Densidad",
          las=1, lwd=3, col="deepskyblue3")
    grid()
  })
  
  output$med_var <- renderText({
    esperanza <- (input$shape) * input$scale
    varianza <- (input$shape) * input$scale^2
    paste(c("Para esta configuración E(X) =", round(esperanza, 2),
            "con Var(X) =", round(varianza, 2)))
  })
  
})