# NOT RUN {
par(mfrow = c(3, 1))
hist(Teacher$salary[Teacher$year == "1973-74"],
main = "Teacher salary 1973-74", xlab = "salary",
xlim = range(Teacher$salary, na.rm = TRUE))
hist(Teacher$salary[Teacher$year == "1983-84"],
main = "Teacher salary 1983-84", xlab = "salary",
xlim = range(Teacher$salary, na.rm = TRUE))
hist(Teacher$salary[Teacher$year == "1993-94"],
main = "Teacher salary 1993-94", xlab = "salary",
xlim = range(Teacher$salary, na.rm = TRUE))
par(mfrow = c(1, 1))
# }
# NOT RUN {
library(ggplot2)
ggplot2::ggplot(data = Teacher, aes(x = salary)) +
geom_histogram(fill = "purple", color = "black") +
facet_grid(year ~ .) +
theme_bw()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab