Histogram with Corrected Code333
number_of_defects <- c(rep(0, 41), rep(1, 31), rep(2, 15), rep(3, 8), rep(4, 8))
hist(number_of_defects, breaks = c(seq(from = -1, 4, by = 1)), xlab = "Defects", main = "Number of Defects", labels = TRUE, ylim = c(0,50))

number_of_defects <- c(rep(0, 41), rep(1, 31), rep(2, 15), rep(3, 8), rep(4, 8))
hist(number_of_defects, breaks = c(seq(from = -1, 4, by = 1)), xlab = "Defects", main = "Number of Defects", labels = TRUE, ylim = c(0,30))

error.data = c(rep(0,41), rep(1,31), rep(2,15), rep(3,8), rep(4,5))
hist(error.data, breaks = c(seq(from = -0.5, 4.5, by =1)), xlab = "defects", main = "Number of Defects", labels = TRUE, ylim = c(0,50))

mean(error.data)
## [1] 1.05
median(error.data)
## [1] 1
sd(error.data)
## [1] 1.157976
boxplot(error.data, horizontal = TRUE, xlab = "Number of Defects")
