-
Notifications
You must be signed in to change notification settings - Fork 1
/
clase10_r.Rmd
68 lines (56 loc) · 1.68 KB
/
clase10_r.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
55
56
57
58
59
60
61
62
63
64
65
66
67
---
title: "Clase 10 - Diplomado en analítica"
author: "Luis Daniel Chavarría"
date: "21/2/2020"
output: html_document
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Lectura de datos
```{r}
library(tidyverse)
library(lubridate)
library(plotly)
```
# Lectura de datos
```{r}
diplomado <- read_csv2("database/clean_diplomate.csv") %>%
filter(!(estotal == "SD" | estotal == "N/A")) %>%
mutate(estb1 = as.numeric(estb1),
estb3 = as.numeric(estb3),
estotal = as.numeric(estotal),
estuce = as.numeric(estuce),
estuci = as.numeric(estuci),
atencion = as.character(atencion),
id = as.character(id),
edad = as.numeric(edad),
genero = as_factor(genero),
cronico = as_factor(cronico),
segcronico = as_factor(segcronico),
eps = as_factor(eps),
espinter = as_factor(espinter),
urg = as_factor(urg),
tipurg = as_factor(tipurg),
inter = as_factor(inter),
ordurg = as_factor(ordurg),
cirugia = as_factor(cirugia),
proc = as_factor(proc),
pisodes = as_factor(pisodes),
esp = as_factor(esp),
anoing = as_date(anoing),
mesing = as.character(mesing),
diaing = as.character(diaing)
)
```
# Clase 10 - Diplomado en analítica
Asociar factores a la forma de los puntos. Habrán tantas formas como niveles del factor.
## Forma manual
```{r}
ggplot(diplomado, aes(x = esturg, y = estuci, color = genero, shape = genero)) +
geom_jitter() +
scale_shape_manual(values = c(24, 25)) +
scale_color_manual(values = c("red", "blue"))
```