Skip to content

Commit

Permalink
Update 05-2 es
Browse files Browse the repository at this point in the history
  • Loading branch information
amateo250 committed Apr 19, 2024
1 parent 08d1beb commit f49da16
Show file tree
Hide file tree
Showing 16 changed files with 132 additions and 132 deletions.
136 changes: 68 additions & 68 deletions intro/intro05-2_es/intro05-2_es.Rmd

Large diffs are not rendered by default.

124 changes: 62 additions & 62 deletions intro/intro05-2_es/intro05-2_es.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

El orden de las capas suele ser el siguiente:

1) **"Abrir" la trama**
1) **"Abrir" el gráfico**

--

Expand All @@ -88,7 +88,7 @@

--

5) **Añade elementos "temáticos" al diseño de la trama** como etiquetas de ejes, título, leyenda, fuentes, tamaños de texto, temas de fondo o rotación de ejes
5) **Añade elementos "temáticos" al diseño de el gráfico** como etiquetas de ejes, título, leyenda, fuentes, tamaños de texto, temas de fondo o rotación de ejes

???
Recuerda que aunque los comandos sean largos, es infinitamente más fácil editar y reciclar que en Excel
Expand Down Expand Up @@ -183,10 +183,10 @@

```r
ggplot(
data = surv,
data = vig,
mapping = aes(
x = district,
fill = sex)) +
x = distrito,
fill = sexo)) +
geom_bar()
```

Expand All @@ -196,7 +196,7 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-26-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-26-1.png" width="504" />

]

Expand All @@ -212,15 +212,15 @@

```r
ggplot(
data = surv,
data = vig,
mapping = aes(
x = district,
fill = sex)) +
x = distrito,
fill = sexo)) +
geom_bar() +
*scale_fill_manual(
* values = c(
* "male" = "violetred",
* "female" = "aquamarine"))
* "hombre" = "violetred",
* "mujer" = "aquamarine"))
```

En `scale_fill_manual()` proporcionamos **manual** tareas
Expand All @@ -233,7 +233,7 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-28-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-28-1.png" width="504" />

]

Expand All @@ -249,10 +249,10 @@

```r
ggplot(
data = surv,
data = vig,
mapping = aes(
x = district,
fill = sex)) +
x = distrito,
fill = sexo)) +
geom_bar() +
*scale_fill_brewer(
* type = "qual",
Expand All @@ -268,7 +268,7 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-30-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-30-1.png" width="504" />

]

Expand All @@ -279,20 +279,20 @@

# Escalas - eje y ajustado

.tirar-izquierda\[
.pull-left[


```r
ggplot(
data = surv,
data = vig,
mapping = aes(
x = district,
fill = sex)) +
x = distrito,
fill = sexo)) +
geom_bar() +
scale_fill_manual(
values = c(
"male" = "violetred",
"female" = "aquamarine")) +
"hombre" = "violetred",
"mujer" = "aquamarine")) +
*scale_y_continuous(
* breaks = seq(from = 0,
* to = 250,
Expand All @@ -305,28 +305,28 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-32-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-32-1.png" width="504" />

]

---

# Escalas - inicia los ejes en 0

.tirar-izquierda\[
.pull-left[


```r
ggplot(
data = surv,
data = vig,
mapping = aes(
x = district,
fill = sex)) +
x = distrito,
fill = sexo)) +
geom_bar() +
scale_fill_manual(
values = c(
"male" = "violetred",
"female" = "aquamarine")) +
"hombre" = "violetred",
"mujer" = "aquamarine")) +
scale_y_continuous(
breaks = seq(from = 0,
to = 250,
Expand All @@ -336,13 +336,13 @@
* expand = c(0, 0))
```

En `scale_x_` o `scale_y_` utiliza `expand = c(0,0)` para eliminar el espacio sobrante alrededor de la trama.
En `scale_x_` o `scale_y_` utiliza `expand = c(0,0)` para eliminar el espacio sobrante alrededor de el gráfico.

]

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-34-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-34-1.png" width="504" />

]

Expand All @@ -355,8 +355,8 @@

```r
ggplot(
data = surv,
mapping = aes(x = date_onset)) +
data = vig,
mapping = aes(x = fecha_sintomas)) +
geom_histogram()
```

Expand All @@ -366,7 +366,7 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-36-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-36-1.png" width="504" />

]

Expand All @@ -385,8 +385,8 @@

```r
ggplot(
data = surv,
mapping = aes(x = date_onset)) +
data = vig,
mapping = aes(x = fecha_sintomas)) +
geom_histogram() +
*scale_x_date(
* date_breaks = "2 months") #2 meses
Expand All @@ -402,7 +402,7 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-41-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-41-1.png" width="504" />

]

Expand All @@ -418,8 +418,8 @@

```r
ggplot(
data = surv,
mapping = aes(x = date_onset)) +
data = vig,
mapping = aes(x = fecha_sintomas)) +
geom_histogram() +
scale_x_date(
date_breaks = "2 months",
Expand All @@ -438,7 +438,7 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-43-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-43-1.png" width="504" />

]

Expand All @@ -460,8 +460,8 @@

```r
ggplot(
data = surv,
mapping = aes(x = date_onset)) +
data = vig,
mapping = aes(x = fecha_sintomas)) +
geom_histogram() +
scale_x_date(
* date_breaks = "2 weeks", #2 semanas
Expand All @@ -476,7 +476,7 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-48-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-48-1.png" width="504" />

]

Expand All @@ -492,14 +492,14 @@

# Etiquetas de parcela

.tirar-izquierda\[
.pull-left[


```r
ggplot(
data = surv,
data = vig,
mapping = aes(
x = date_onset,
x = fecha_sintomas,
fill = hospital)) +
geom_histogram() +
scale_x_date(
Expand All @@ -513,15 +513,15 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-51-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-51-1.png" width="504" />

]

---

# Etiquetas de parcela

.tirar-izquierda\[
.pull-left[



Expand All @@ -532,9 +532,9 @@

```r
ggplot(
data = surv,
data = vig,
mapping = aes(
x = date_onset,
x = fecha_sintomas,
fill = hospital)) +
geom_histogram() +
scale_x_date(
Expand Down Expand Up @@ -564,7 +564,7 @@



<img src="intro5_2_es_files/figure-html/unnamed-chunk-59-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-59-1.png" width="504" />

]

Expand Down Expand Up @@ -596,11 +596,11 @@


```r
str_glue("{fmt_count(surv, is.na(date_onset))} casos que faltan para el inicio y no se muestran")
str_glue("{fmt_count(vig, is.na(fecha_sintomas))} casos sin fecha de inicio síntomas")
```

```
## 33 (5.2%) casos que faltan para el inicio y no se muestran
## 33 (5.2%) casos sin fecha de inicio síntomas
```

.footnote[Ver el [capítulo sobre cadenas del Manual de Epi](https://epirhandbook.com/characters-and-strings.html#dynamic-strings) y el capítulo {stringr} paquete.
Expand All @@ -624,7 +624,7 @@

Los temas son **sin datos** de diseño, por ejemplo:

- Fondo del lienzo de trama
- Fondo del lienzo del gráfico
- Tamaño, color y orientación del texto
- Posición de la leyenda

Expand Down Expand Up @@ -666,7 +666,7 @@

.pull-right[

<img src="intro5_2_es_files/figure-html/unnamed-chunk-73-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-73-1.png" width="504" />

]

Expand All @@ -678,7 +678,7 @@

Proporciona argumentos para cada pequeño cambio que quieras hacer, por ejemplo:

| Componente de trama | Argumento temático |
| Componente del gráfico | Argumento temático |
| ----------------------------------------------- | ------------------ |
| posición de la leyenda | `legend.position = ` |
| dirección de la leyenda (horizontal o vertical) | `legend.direction = ` |
Expand All @@ -687,7 +687,7 @@

Pueden ser *muy muy* específicos:

| Componente de la trama | Argumento temático |
| Componente de el gráfico | Argumento temático |
| ----------------------------------------------- | ------------------ |
| Longitud de las marcas del eje X | `axis.ticks.length.x = ` |

Expand All @@ -713,11 +713,11 @@

```r
ggplot(
data = surv,
data = vig,
mapping = aes(
x = age_years,
y = ht_cm,
color = sex),
x = edad_anios,
y = alt_cm,
color = sexo),
alpha = 0.3) +
geom_point() +
labs(
Expand Down Expand Up @@ -746,7 +746,7 @@



<img src="intro5_2_es_files/figure-html/unnamed-chunk-81-1.png" width="504" />
<img src="intro05-2_es_files/figure-html/unnamed-chunk-81-1.png" width="504" />

]

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f49da16

Please sign in to comment.