Exercício - Visualização de Dados

Author

Luis Olivera

Published

October 27, 2024

Leyendo los datos

Code
surveys_data <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2023/2023-05-02/surveys.csv", show_col_types = FALSE)

Cargando librerias

Code
Warning: package 'dplyr' was built under R version 4.3.3
Warning: package 'ggplot2' was built under R version 4.3.3

Opção 6

Code
ggplot(surveys_data, aes(x = treatment, y = wgt, fill = sex)) +
  geom_boxplot(alpha = 0.7, outlier.color = "grey", outlier.shape = 16) +
  labs(title = "Peso de Animales por Tratamiento y Sexo",
       x = "Tratamiento",
       y = "Peso (g)",
       fill = "Sexo") + 
  scale_fill_manual(values = c("blue", "green")) +
  theme_minimal() +
  theme(plot.title = element_text(hjust = 0.5))
Warning: Removed 675 rows containing non-finite outside the scale range
(`stat_boxplot()`).