Programs 9

Author

Ashutosh

Quarto

  1. Create multiple historgram using ggplot2 and facet wrap to visualize how a variable is distributed across different groups in a built-in R database.
library(ggplot2)
ggplot(iris, aes(x = Sepal.Length)) +
  geom_histogram(binwidth = 0.3, fill = "skyblue", color = "black") +
  facet_wrap(~ Species) + 
  labs(
    title = "Distribution of Sepal Length by Species",
    x = "Sepal Length",
    y = "Count"
  ) +
  theme_minimal()