PART B
9) --- title: "prg9" author: "Kiran T L" format: docx editor: visual --- Objectives Create multiple histograms using ggplot2::facet_wrap() to visualize how a variable (e.g., Sepal.Length ) is distrubuted across different groups (e.g., Species ) in a built-in R dataset. {r} #Load the ggplot2 pckage library(ggplot2) Step 1: Load and Explore the Dateset {r} # Load the iris databset data("iris") # View the first few row of the datset head(iris) Step 2: Create grouped histograms using Facet_wrap {r} #Create histogram using Facet_wrap for grouped data 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 (cm)", y = "Frequency")+ theme_minimal() 10) # Install package (only first time) install.packages("ggplot2") # Load library library...