library(ggplot2)
PRG 11 DV
PROGRAM 11
To generate a basic box plot using ggplot2, enhanced with notches and outliers,and grouped by a categorical variable using an in-built dataset R
Step1 : load the reqiures library
step 2: using the iris dataset
data(iris)
step 3: create a box plot with notches
ggplot(iris, aes(x = Species, y = Sepal.Length))+
geom_boxplot(
notch = TRUE,
notchwidth = 0.5,
notchheigth = 0.8,
outliner.color = "black",
fill = "red" ) +
labs(title = "basic box plot",
x = "Species" ,
y = "Sepal.Length")+
theme_minimal()
Warning in geom_boxplot(notch = TRUE, notchwidth = 0.5, notchheigth = 0.8, :
Ignoring unknown parameters: `notchheigth` and `outliner.colour`