-
Notifications
You must be signed in to change notification settings - Fork 1
/
Shinny_.Rmd
54 lines (34 loc) · 1.25 KB
/
Shinny_.Rmd
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
---
runtime: shiny
output: html_document
---
# Este es un encabezado
## Este es un encabezado de segundo nivel
### Este es un encabezado de tercer nivel
#### Ejemplos de interactividad con Shiny para
```{r echo = FALSE}
selectInput("n_breaks", label = "Numero de cajas:",
choices = c(5, 10, 20, 35, 50, 100), selected = 20)
a <-sliderInput("bw_adjust", label = "Ancho de la caja:",
min = 0.2, max = 3, value = 1, step = 0.2)
b <-sliderInput("bw_adjust", label = "Ancho de la caja:",
min = 0.2, max = 3, value = 1, step = 0.2)
c1 <-sliderInput("bw_adjust", label = "Ancho de la caja:",
min = 0.2, max = 3, value = 1, step = 0.2)
c2 <-sliderInput("bw_adjust", label = "Ancho de la caja:",
min = 0.2, max = 3, value = 1, step = 0.2)
```
### ...construir un histograma
```{r echo = FALSE}
renderPlot({
hist(aleatoria, probability = TRUE, breaks = as.numeric(input$n_breaks),
xlab = "Datos", main = "Variable aleatoria")
dens <- density(aleatoria, adjust = input$bw_adjust)
lines(dens, col = "blue")
})
```
```{r setup, include = FALSE}
library(ggplot2)
library(dplyr)
knitr::opts_chunk$set(fig.width = 5, fig.asp = 1/3)
```