After having defined the features, we can explore them and identify how they are related to the problem. In this section, you will see how to explore the data and define some simple charts.
Let's start with a feature, for instance,
mainhue, which displays the predominant color of a flag. We want to identify the most common predominant colors, and for that purpose, we can use
table to count the number of occurrences of each possible value. We can extract the
mainhue column from
dtFlag and apply
table to it:
table(dtFlag[, mainhue]) black blue brown gold green orange red white 5 40 2 19 31 4 71 22
The three most common predominant colors are red, blue, and green. Please note that we could have put
table inside ...