Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Laboratorio 3e
Laboratorio 3e
Pantallazo:
2)
df <- CALIFICAT17A
df %>% head(5) %>% flextable::flextable()
Pantallazo:
3)
# Histogram
theme_set(theme_light())
df %>% ggplot(aes(x = CONTROLES,fill = RIESGO, color = RIESGO)) +
geom_histogram(alpha = 0.5,position = position_stack()) +
theme(legend.position = c(.90, .85))
Pantallazo:
4)
# Density plot
theme_set(theme_pander())
df %>% ggplot(aes(x = CONTROLES,fill = RIESGO, color = RIESGO)) +
geom_density(alpha = 0.5) + theme(legend.position = c(.90, .85))
Pantallazo:
5)
# Box plot
theme_set(theme_bw())
df %>% ggplot(aes(x = RIESGO,y = CONTROLES,fill = RIESGO, color =
RIESGO)) +
geom_boxplot(alpha = 0.5,width = 0.3) +
theme(legend.position = "none")
Pantallazo:
Pantallazo:
Análisis:
7)
# Dot plot
theme_set(theme_minimal())
df %>% ggplot(aes(x = RIESGO,y = CONTROLES,fill = RIESGO, color =
RIESGO)) +
geom_dots(alpha = 0.5,dotsize = 0.5) +
theme(legend.position = "none")
Pantallazo:
Análisis: Se puede observar que los datos de tipo medio se ven un poco
alto en comparación con los otros riesgos.
8)
# Beeswarm plot
theme_set(theme_minimal())
df %>% ggplot(aes(x = RIESGO,y = CONTROLES,fill = RIESGO, color =
RIESGO)) +
geom_beeswarm(alpha = 0.5) +
theme(legend.position = "none")
Pantallazo:
Análisis: Se puede observar que los datos de tipo medio se ven más
alto en comparación con los otros riesgos.
9)
# Jitter/strip plot
theme_set(theme_classic())
df %>% ggplot(aes(x = RIESGO,y = CONTROLES,fill = RIESGO, color =
RIESGO)) +
geom_jitter(alpha = 0.6,position = position_jitter(width = 0.12)) +
theme(legend.position = "none")
Pantallazo:
Análisis: Se puede observar que los puntos son más densos para los
controles con calificación media
10)
# Eye plot
theme_set(theme_light())
df %>% ggplot(aes(x = RIESGO,y = CONTROLES,fill = RIESGO, color =
RIESGO)) +
stat_eye(alpha = 0.3) +
theme(legend.position = "none")
Pantallazo:
11)
# Half eye plot
theme_set(theme_pander())
df %>% ggplot(aes(x = RIESGO,y = CONTROLES,fill = RIESGO, color =
RIESGO)) +
stat_halfeye(alpha = 0.3, justification = -0.1) +
theme(legend.position = "none")
Pantallazo:
12)
# Rain drop plot
theme_set(theme_bw())
df %>% ggplot(aes(x = RIESGO,y = CONTROLES,fill = RIESGO, color =
RIESGO)) +
stat_halfeye(alpha = 0.3, justification = -0.1,adjust = 0.4) +
geom_boxplot(width = 0.1, alpha = 0.4) +
stat_dots(side = "left", justification = 1.1,dotsize = 0.5,alpha =
0.5,adjust = 0.4) +
coord_flip() +
theme(legend.position = "none")
Pantallazo:
Análisis:
13)
# Flat violin
theme_set(theme_minimal())
df %>% ggplot(aes(x = RIESGO,y = CONTROLES,fill = RIESGO, color =
RIESGO)) +
geom_flat_violin(alpha = 0.5,adjust = 0.5) +
stat_dots(side = "left", justification = 1.1,dotsize = 0.5,alpha =
0.5,adjust = 0.4) +
coord_flip() +
theme(legend.position = "none")
Pantallazo:
14)
# Fill Density plot
theme_set(theme_pander())
df %>% ggplot(aes(x = CONTROLES,fill = RIESGO, color = RIESGO)) +
geom_density(alpha = 0.5,position = "fill") + theme(legend.position
= c(.90, .85))
Pantallazo: