mclust
contains a data set called
banknote
, consisting of (physical) measurements on 200
Swiss bank notes, 100 of which are genuine, while the other half is
counterfeit. Load this data set (you might have to install the package)
using the code below.# install.packages("mclust")
library(mclust) # if this throws an error of the form 'there is no package called mcmclust', uncomment the line above, run it once, then comment the line out again and run the code chunk again.
data(banknote)
ggplot2
to draw a barchart of
Status
. Map Status
to the fill color of the
barchart.ggplot2
to draw a histogram of
one of the variables in the dataset that shows a distinction between
genuine and counterfeit banknotes. Use fill color to show this
difference. Choose the binwidth such that there are no gaps in the
middle range of the histogram.ggplot2
to draw a scatterplot of
two (continuous) measurements, color by Status
. Find a pair
of measurements that allow you to separate perfectly between genuine and
counterfeit banknotes.For the submission: submit your solution in an R Markdown file. Also submit the corresponding html/word file with it.