### QUESTION 11
#
## Topic: Sheet 9, Exercise 3
## Question:
# I tried to plot the results in sheet 9 exercise 3 in a different way than in the solution.
# But somehow it doesn't work. Could you explain me, what is wrong there?
# dataset read with my path to it
mite <- read.table("../exercises/solutions/data/mite.txt", header = TRUE)
# code from the student
png(file = "mite.png")
par(mfrow = c(1, 2))
boxplot(mite$number[mite$first.encounter == "no"],
col = "white",
sub = "first encounter",
ylim = c(0,400))
boxplot(mite$number[mite$first.encounter == "yes"],
col = "red",
sub = "second encounter",
ylim = c(0,400))
# Answer
# You need to add the command dev.off() so that the file mite.png that you created is closed (and the graph is saved to it).
dev.off()
## png
## 2