Introduction

First, let’s have a look at the major types of tea.
These studies are mainly focused on types, rather than their taxonomic classification.

So the main separation is:
1. Pu-erh Shou/Ripe
2. Pu-erh Sheng/Raw
3. White
4. Green
5. Oolong
6. Red/Black
7. Purple

Between white and green we could also put yellow.
However that one is not going to be discussed, hence if you’d like me
to conduct research with yellow teas as well let me know.
Oolongs also separate further and there is just so many,
we will stick with the ones I’ve listed for this study.

Dataset for these studies

Basic types of tea
Tea Caffeine_mg_per_g Antioxidants_mg_per_g
Pu-erh Shou/Ripe 15 120
Pu-erh Sheng/Raw 25 150
White 10 140
Green 25 160
Oolong 20 130
Red/Black 35 110
Purple 40 135

Caffeine content in different types of tea | mg’s per 1g

ggplot(tea_data, aes(x = Tea, y = Caffeine_mg_per_g, fill = Tea)) +
  geom_bar(stat = "identity") +
  theme_minimal() +
  labs(title = "Caffeine content per 1 gram of tea", x = "Tea type", y = "Caffeine (mg per gram)") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Amount of antioxidants in different types of tea | mg’s per 1g

ggplot(tea_data, aes(x = Tea, y = Antioxidants_mg_per_g, fill = Tea)) +
  geom_bar(stat = "identity") +
  theme_minimal() +
  labs(title = "Antioxidant content per gram of tea", 
       x = "Tea type", 
       y = "Antioxidants (mg per gram)") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Caffeine vs. antioxidant content in different types of tea

ggplot(tea_data, aes(x = Caffeine_mg_per_g, y = Antioxidants_mg_per_g, color = Tea)) +
  geom_point(size = 4) +
  theme_minimal() +
  labs(title = "Caffeine vs. antioxidant content in teas",
       x = "Caffeine (mg per gram)",
       y = "Antioxidants (mg per gram)") +
  theme(legend.position = "bottom")

Scoring the teas based on different preferences

The formula used for scoring teas:
Score = (Normalized Caffeine * Weight for Caffeine) + (Normalized Antioxidants * Weight for Antioxidants)

First let’s normalize the values.

tea_data$Normalized_Caffeine <- (tea_data$Caffeine_mg_per_g - min(tea_data$Caffeine_mg_per_g)) /
  (max(tea_data$Caffeine_mg_per_g) - min(tea_data$Caffeine_mg_per_g))

tea_data$Normalized_Antioxidants <- (tea_data$Antioxidants_mg_per_g - min(tea_data$Antioxidants_mg_per_g)) /
  (max(tea_data$Antioxidants_mg_per_g) - min(tea_data$Antioxidants_mg_per_g))

Now choose weights.
In this case, I chose that caffeine is more important for me than the amount of antioxidants.
The scale goes from 0 to 1.

weight_caffeine <- 0.7
weight_antioxidants <- 0.3

Calculating the weighted score.

tea_data$Score <- (tea_data$Normalized_Caffeine * weight_caffeine) + 
                  (tea_data$Normalized_Antioxidants * weight_antioxidants)

Sorting the data. (best tea for me according to my preferences)

tea_data_sorted <- tea_data[order(-tea_data$Score), ]

And lastly, the final table and visualization of teas sorted by my preferences.

kable(tea_data_sorted, caption = "Teas sorted based on my preferences")
Teas sorted based on my preferences
Tea Caffeine_mg_per_g Antioxidants_mg_per_g Normalized_Caffeine Normalized_Antioxidants Score
7 Purple 40 135 1.0000000 0.5 0.8500000
4 Green 25 160 0.5000000 1.0 0.6500000
2 Pu-erh Sheng/Raw 25 150 0.5000000 0.8 0.5900000
6 Red/Black 35 110 0.8333333 0.0 0.5833333
5 Oolong 20 130 0.3333333 0.4 0.3533333
3 White 10 140 0.0000000 0.6 0.1800000
1 Pu-erh Shou/Ripe 15 120 0.1666667 0.2 0.1766667
ggplot(tea_data_sorted, aes(x = reorder(Tea, Score), y = Score, fill = Tea)) +
  geom_bar(stat = "identity") +
  theme_minimal() +
  labs(title = "Teas sorted based on my preferences",
       x = "Tea type", y = "Weighted score") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))