Está en la página 1de 8

LABORATORIO 3E

Nombre: Iveth Allisson´s Velasquez Quispe


1)
library(ggdist)
library(ggbeeswarm)
library(patchwork)
library(PupillometryR)
library(janitor)
library(ggthemes)
library(tidyquant)
library(tidylog)
library(flextable)
library(tidyverse)

Pantallazo:
2)

df <- CALIFICAT17A
df %>% head(5) %>% flextable::flextable()

Pantallazo:

Análisis: lo que hace head(5) es mostrar una tabla formateada de los 5


primeros archivos

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:

Análisis: En el grafico se puede observar un histograma que analiza


los controles de una empresa y el riesgo. Los rojos son los riesgos
que obtuvieron una calificación alta, los verdes tuvieron una
calificación baja y los azules tuvieron un riesgo medio.

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:

Análisis: Se puede observar la densidad de los controles

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:

Análisis: se puede observar la misma relación entre el riesgo y los


controles, se puede ver que los controles altos están entre 80 y 100,
los de calificación baja este de 65 para abajo y los de controles con
calificación media están entre 80 y 69.
6)
# Violin plot
theme_set(theme_minimal())
df %>% ggplot(aes(x = RIESGO,y = CONTROLES,fill = RIESGO, color =
RIESGO)) +
geom_violin(alpha = 0.5,width = 0.5) +
theme(legend.position = "none")

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:

Análisis: Se puede observar los riesgos calificados en tres tipos y


los controles, se puede ver que hay muchos controles que tienen
calificación media y se ve que el riesgo es elevado.

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:

También podría gustarte