Load packages
# Packages
library(tidyverse)
library(patchwork)
library(latex2exp)
library(kableExtra)
library(papaja)
library(extrafont)
used in the experiment reported in the article #Knowledge: Improving food-related knowledge via seeding implemented as a social media intervention
October 9, 2024
# Plot colors
clrs <- c("#54AA8F","#00335B",
"#22A884FF","#414487FF",
"#496aa2","#e46c0a","#90b6d4")
# ggplot theme
theme_nice <- function(){
theme_minimal(base_family = "Jost") +
theme(plot.title = element_text(hjust = 0.5,size = 20),
panel.grid.minor = element_blank(),
text = element_text(size = 20),
panel.border = element_rect(colour = "black", linewidth = 0.5, fill = NA),
axis.title.x = element_text(margin = unit(c(3, 0, 0, 0), "mm")),
axis.title.y = element_text(margin = unit(c(3, 3, 0, 0), "mm"), angle = 90),
legend.title = element_text(face = "bold",size=16),
strip.text = element_text(face = "bold"),
legend.position = "bottom"
)}
p_size <- 3
lwd <- 1.5
items %>%
summarise(M_CO2 = mean(`g CO2 pro kg`),
SD_CO2 = sd(`g CO2 pro kg`),
Min_CO2 = min(`g CO2 pro kg`),
Max_CO2 = max(`g CO2 pro kg`),
M_Kcal = mean(`Kcal pro 100g`),
SD_Kcal = sd(`Kcal pro 100g`),
Min_Kcal = min(`Kcal pro 100g`),
Max_Kcal = max(`Kcal pro 100g`),
.by="category") %>%
mutate_if(is.numeric,printnum) %>%
kbl(col.names = c("Category",rep(c("M","SD","Min","Max"),2))) %>%
kable_paper() %>%
add_header_above(c(" " = 1, "g CO2 pro kg" = 4, "Kcal pro 100g" = 4))
g CO2 pro kg
|
Kcal pro 100g
|
|||||||
---|---|---|---|---|---|---|---|---|
Category | M | SD | Min | Max | M | SD | Min | Max |
fruit & vegetables | 740.83 | 297.58 | 310.00 | 1,190.00 | 48.42 | 22.20 | 16.00 | 93.00 |
meat & fish | 11,070.83 | 8,074.22 | 4,640.00 | 26,920.00 | 165.58 | 117.63 | 60.00 | 502.00 |
dairy | 5,264.17 | 3,705.50 | 1,560.00 | 13,090.00 | 235.17 | 194.97 | 46.00 | 741.00 |
grain products | 1,257.50 | 835.20 | 560.00 | 3,390.00 | 303.33 | 71.48 | 150.00 | 379.00 |
sweets | 2,899.17 | 1,702.25 | 1,030.00 | 6,250.00 | 413.08 | 130.07 | 160.00 | 567.00 |
Category | M | SD | Min | Max |
---|---|---|---|---|
fruit & vegetables | 736.67 | 414.05 | 360.00 | 1,180.00 |
meat & fish | 11,710.00 | 10,571.43 | 5,060.00 | 23,900.00 |
dairy | 5,846.67 | 4,197.35 | 1,800.00 | 10,180.00 |
grain products | 1,363.33 | 781.37 | 670.00 | 2,210.00 |
sweets | 3,150.00 | 2,289.08 | 1,100.00 | 5,620.00 |
items %>%
filter(seeding_Kcal == 1) %>%
summarise(M_Kcal = mean(`Kcal pro 100g`),
SD_Kcal = sd(`Kcal pro 100g`),
Min_Kcal = min(`Kcal pro 100g`),
Max_Kcal = max(`Kcal pro 100g`),
.by=c("category")) %>%
mutate_if(is.numeric,printnum) %>%
kbl(col.names = c("Category","M","SD","Min","Max")) %>%
kable_paper()
Category | M | SD | Min | Max |
---|---|---|---|---|
fruit & vegetables | 42.67 | 25.70 | 19.00 | 70.00 |
meat & fish | 156.67 | 74.78 | 73.00 | 217.00 |
dairy | 248.00 | 152.83 | 78.00 | 374.00 |
grain products | 305.33 | 83.27 | 212.00 | 372.00 |
sweets | 416.00 | 117.04 | 306.00 | 539.00 |
items %>%
select(ID_item,name,category,`g CO2 pro kg`,`Kcal pro 100g`,`Seeditems CO2` = seeding_CO2,`Seeditems Kcal` = seeding_Kcal) %>%
kbl(align = "c") %>%
column_spec(4,color = "white",background = spec_color(items$`g CO2 pro kg`)) %>%
column_spec(5,color = "white",background = spec_color(items$`Kcal pro 100g`,option = "D")) %>%
kable_styling(fixed_thead = T)
ID_item | name | category | g CO2 pro kg | Kcal pro 100g | Seeditems CO2 | Seeditems Kcal |
---|---|---|---|---|---|---|
1 | Zucchinis | fruit & vegetables | 860 | 19 | 0 | 1 |
2 | Potatoes | fruit & vegetables | 360 | 71 | 1 | 0 |
3 | Bell pepper | fruit & vegetables | 1190 | 38 | 0 | 0 |
4 | Carrots | fruit & vegetables | 310 | 39 | 0 | 1 |
5 | Broccoli | fruit & vegetables | 1180 | 34 | 1 | 0 |
6 | Lettuce (Iceberg) | fruit & vegetables | 590 | 16 | 0 | 0 |
7 | Pineapples | fruit & vegetables | 680 | 57 | 0 | 0 |
8 | Apple | fruit & vegetables | 500 | 54 | 0 | 0 |
9 | Banana | fruit & vegetables | 990 | 93 | 0 | 0 |
10 | Orange | fruit & vegetables | 670 | 47 | 1 | 0 |
11 | Grapes | fruit & vegetables | 580 | 70 | 0 | 1 |
12 | Raspberries | fruit & vegetables | 980 | 43 | 0 | 0 |
13 | Goat | meat & fish | 20960 | 198 | 0 | 0 |
14 | Fish fingers (frozen) | meat & fish | 6400 | 188 | 0 | 0 |
15 | Meatballs | meat & fish | 5670 | 217 | 0 | 1 |
16 | Salami | meat & fish | 5060 | 502 | 1 | 0 |
17 | Beef | meat & fish | 26920 | 98 | 0 | 0 |
18 | Pork | meat & fish | 6620 | 147 | 0 | 0 |
19 | Chicken | meat & fish | 4640 | 102 | 0 | 0 |
20 | Lamb | meat & fish | 23900 | 112 | 1 | 0 |
21 | Octopus | meat & fish | 6170 | 73 | 1 | 1 |
22 | Salmon | meat & fish | 6820 | 180 | 0 | 1 |
23 | Shrimp (frozen) | meat & fish | 12100 | 60 | 0 | 0 |
24 | Tuna (canned) | meat & fish | 7590 | 110 | 0 | 0 |
25 | Quark (low-fat) | dairy | 2450 | 70 | 0 | 0 |
26 | Butter | dairy | 10180 | 741 | 1 | 0 |
27 | Milk | dairy | 1800 | 46 | 1 | 0 |
28 | Cream (30%) | dairy | 5010 | 292 | 0 | 1 |
29 | Eggs | dairy | 2540 | 137 | 0 | 0 |
30 | Sour Cream | dairy | 4260 | 147 | 0 | 0 |
31 | Gouda | dairy | 13090 | 364 | 0 | 0 |
32 | Mozzarella | dairy | 7660 | 238 | 0 | 0 |
33 | Parmesan | dairy | 7410 | 374 | 0 | 1 |
34 | Feta | dairy | 5560 | 234 | 1 | 0 |
35 | Yogurt | dairy | 1650 | 78 | 0 | 1 |
36 | Fruit Yogurt | dairy | 1560 | 101 | 0 | 0 |
37 | Rye bread | grain products | 1210 | 212 | 1 | 1 |
38 | Wheat bread | grain products | 720 | 285 | 0 | 0 |
39 | Croissant | grain products | 3390 | 332 | 0 | 1 |
40 | Rice (raw) | grain products | 2210 | 361 | 1 | 0 |
41 | Pizza dough | grain products | 720 | 235 | 0 | 0 |
42 | Gnocchi | grain products | 600 | 150 | 0 | 0 |
43 | Tortilla bread, wheat | grain products | 740 | 304 | 0 | 0 |
44 | Bulgur (raw) | grain products | 560 | 314 | 0 | 0 |
45 | Corn flakes | grain products | 1510 | 379 | 0 | 0 |
46 | Pasta (raw) | grain products | 1460 | 330 | 0 | 0 |
47 | Quinoa (raw) | grain products | 1300 | 366 | 0 | 0 |
48 | Oat flakes | grain products | 670 | 372 | 1 | 1 |
49 | Chocolate chip cookie | sweets | 2730 | 434 | 1 | 0 |
50 | Chocolate cake | sweets | 2360 | 360 | 0 | 0 |
51 | Chips | sweets | 3290 | 503 | 0 | 0 |
52 | Nutella | sweets | 3970 | 539 | 0 | 0 |
53 | Popcorn | sweets | 1100 | 403 | 1 | 1 |
54 | Ice cream | sweets | 3310 | 160 | 0 | 0 |
55 | Sugar | sweets | 1030 | 405 | 0 | 0 |
56 | Milk Chocolate | sweets | 5620 | 539 | 1 | 1 |
57 | Marzipan | sweets | 6250 | 512 | 0 | 0 |
58 | Strawberry jam | sweets | 1800 | 229 | 0 | 0 |
59 | Peanuts | sweets | 2150 | 567 | 0 | 0 |
60 | Honey | sweets | 1180 | 306 | 0 | 1 |
15 trivia facts will be shown during the seeding phase (type = Post
) and 6 will be used in a 2AFC-recognition test in the final questionnaire (type = Test
).
trivia <- c("An average ear of corn has an even number of rows, usually 16",
"A watermelon consists of about 95 percent water.",
"Every German needs about 2,700 square meters of farmland for food supply.",
"Children see junk food advertisements an average of 27 times a day.",
"Approximately 500 million snails are eaten in France every year.",
"The largest cashew tree in the world covers an area of 8,500 square meters.",
"The price of food increased by 9 percent between August 2022 and August 2023.",
"Germans eat about 20 kilos of tomatoes per year.",
"Caffeine has a half-life of four to six hours.",
"Chia seeds contain five times more calcium than milk.",
"In Germany, peas were grown on 82,600 hectares of land in 2020.",
"In Germany, approximately 36,000 tons of pears were harvested in 2023.",
"Rosemary can be harvested after a germination period of about four weeks.",
"There are about 30mg of caffeine in a cup of green tea.",
"Farmers plant radishes with approximately 200 seeds per square meter.",
"The cultivation area of corn in Germany is around 472,200 hectares.",
"The German Nutrition Society recommends 400 grams of vegetables per day.",
"McDonald's sells 75 hamburgers per second.",
"Wheat requires about 500 liters of water per kilogram of dry matter.",
"China produced approximately 63 million tons of salt in 2019.",
"There are over 40 different types of kiwi.")
trivia_df <- data.frame(ID = 1:length(trivia),
fact = trivia,
type = c(rep("Post",15),rep("Test",6)))
trivia_df %>%
kbl(align = "c") %>%
kable_styling(fixed_thead = T)
ID | fact | type |
---|---|---|
1 | An average ear of corn has an even number of rows, usually 16 | Post |
2 | A watermelon consists of about 95 percent water. | Post |
3 | Every German needs about 2,700 square meters of farmland for food supply. | Post |
4 | Children see junk food advertisements an average of 27 times a day. | Post |
5 | Approximately 500 million snails are eaten in France every year. | Post |
6 | The largest cashew tree in the world covers an area of 8,500 square meters. | Post |
7 | The price of food increased by 9 percent between August 2022 and August 2023. | Post |
8 | Germans eat about 20 kilos of tomatoes per year. | Post |
9 | Caffeine has a half-life of four to six hours. | Post |
10 | Chia seeds contain five times more calcium than milk. | Post |
11 | In Germany, peas were grown on 82,600 hectares of land in 2020. | Post |
12 | In Germany, approximately 36,000 tons of pears were harvested in 2023. | Post |
13 | Rosemary can be harvested after a germination period of about four weeks. | Post |
14 | There are about 30mg of caffeine in a cup of green tea. | Post |
15 | Farmers plant radishes with approximately 200 seeds per square meter. | Post |
16 | The cultivation area of corn in Germany is around 472,200 hectares. | Test |
17 | The German Nutrition Society recommends 400 grams of vegetables per day. | Test |
18 | McDonald's sells 75 hamburgers per second. | Test |
19 | Wheat requires about 500 liters of water per kilogram of dry matter. | Test |
20 | China produced approximately 63 million tons of salt in 2019. | Test |
21 | There are over 40 different types of kiwi. | Test |
ggplot(items,aes(x = fct_reorder(name,`g CO2 pro kg`),
y = `g CO2 pro kg`,
color = factor(seeding_CO2))) +
geom_point(size=p_size) +
geom_linerange(aes(ymax = `g CO2 pro kg`, ymin = 0),linewidth=lwd) +
facet_wrap(.~category,scales="free",nrow=2)+
labs(title = "",
x = "",
y = "",
color = "Seed Item") +
theme_nice() +
scale_color_manual(values = c("black","#22A884FF")) +
theme(axis.text.x = element_text(angle = 45,hjust = 1)) +
scale_y_continuous(expand = expansion(mult = c(0, 0.2)))
ggplot(items,aes(x = fct_reorder(name,`g CO2 pro kg`),
y = `g CO2 pro kg`,
color = factor(seeding_CO2))) +
geom_point(size=p_size) +
geom_linerange(aes(ymax = `g CO2 pro kg`, ymin = 0),linewidth=lwd) +
facet_wrap(.~category,scales="free",nrow=2)+
labs(title = "",
x = "",
y = "",
color = "Seed Item") +
scale_color_manual(values = c("black","#22A884FF")) +
theme_nice() +
theme(axis.text.x = element_text(angle = 45,hjust = 1)) +
scale_y_continuous(expand = c(0, 0), limits = c(0,28500))
ggplot(items,aes(x = fct_reorder(name,`Kcal pro 100g`),
y = `Kcal pro 100g`,
color = factor(seeding_Kcal))) +
geom_point(size=p_size) +
geom_linerange(aes(ymax = `Kcal pro 100g`, ymin = 0),linewidth=lwd) +
facet_wrap(.~category,scales="free",nrow=2)+
labs(title = "",
x = "",
y = "",
color = "Seed Item") +
scale_color_manual(values = c("black","#22A884FF")) +
theme_nice() +
theme(axis.text.x = element_text(angle = 45,hjust = 1)) +
scale_y_continuous(expansion(mult = c(0, 0.2)))
ggplot(items,aes(x = fct_reorder(name,`Kcal pro 100g`),
y = `Kcal pro 100g`,
color = factor(seeding_Kcal))) +
geom_point(size=p_size) +
geom_linerange(aes(ymax = `Kcal pro 100g`, ymin = 0),linewidth=lwd) +
facet_wrap(.~category,scales="free",nrow=2)+
labs(title = "",
x = "",
y = "",
color = "Seed Item") +
scale_color_manual(values = c("black","#22A884FF")) +
theme_nice() +
theme(axis.text.x = element_text(angle = 45,hjust = 1)) +
scale_y_continuous(expand = c(0, 0), limits = c(0,800))
---
title: "Items"
subtitle: "used in the experiment reported in the article #Knowledge: Improving food-related knowledge via seeding implemented as a social media intervention"
date: "`r Sys.Date()`"
format:
html:
code-fold: true
code-copy: true
code-tools: true
embed-resources: true
df-print: kable
toc: true
toc-location: right
fig-format: svg
page-layout: full
fig-height: 12
fig-width: 13
fig-align: center
pdf:
toc: true
toc-depth: 2
fig-height: 12
fig-width: 13
fig-align: center
df-print: kable
execute:
echo: false
execute:
warning: false
messages: false
editor_options:
chunk_output_type: console
---
```{r setup}
#| code-summary: "Load packages"
# Packages
library(tidyverse)
library(patchwork)
library(latex2exp)
library(kableExtra)
library(papaja)
library(extrafont)
```
```{r ggplot}
#| code-summary: "Define ggplot theme"
# Plot colors
clrs <- c("#54AA8F","#00335B",
"#22A884FF","#414487FF",
"#496aa2","#e46c0a","#90b6d4")
# ggplot theme
theme_nice <- function(){
theme_minimal(base_family = "Jost") +
theme(plot.title = element_text(hjust = 0.5,size = 20),
panel.grid.minor = element_blank(),
text = element_text(size = 20),
panel.border = element_rect(colour = "black", linewidth = 0.5, fill = NA),
axis.title.x = element_text(margin = unit(c(3, 0, 0, 0), "mm")),
axis.title.y = element_text(margin = unit(c(3, 3, 0, 0), "mm"), angle = 90),
legend.title = element_text(face = "bold",size=16),
strip.text = element_text(face = "bold"),
legend.position = "bottom"
)}
p_size <- 3
lwd <- 1.5
```
```{r items}
#| code-summary: "Read in item data"
# Read in items
items <- read_csv2("../Materials/Seeding Fact Items/Items.csv")
```
# Descriptive Summary
## by Food Category
```{r}
items %>%
summarise(M_CO2 = mean(`g CO2 pro kg`),
SD_CO2 = sd(`g CO2 pro kg`),
Min_CO2 = min(`g CO2 pro kg`),
Max_CO2 = max(`g CO2 pro kg`),
M_Kcal = mean(`Kcal pro 100g`),
SD_Kcal = sd(`Kcal pro 100g`),
Min_Kcal = min(`Kcal pro 100g`),
Max_Kcal = max(`Kcal pro 100g`),
.by="category") %>%
mutate_if(is.numeric,printnum) %>%
kbl(col.names = c("Category",rep(c("M","SD","Min","Max"),2))) %>%
kable_paper() %>%
add_header_above(c(" " = 1, "g CO2 pro kg" = 4, "Kcal pro 100g" = 4))
```
## by Seeding Sets
::: {.panel-tabset}
## g CO2 pro kg
```{r}
items %>%
filter(seeding_CO2 == 1) %>%
summarise(M_CO2 = mean(`g CO2 pro kg`),
SD_CO2 = sd(`g CO2 pro kg`),
Min_CO2 = min(`g CO2 pro kg`),
Max_CO2 = max(`g CO2 pro kg`),
.by=c("category")) %>%
mutate_if(is.numeric,printnum) %>%
kbl(col.names = c("Category","M","SD","Min","Max")) %>%
kable_paper()
```
## Kcal pro 100g
```{r}
items %>%
filter(seeding_Kcal == 1) %>%
summarise(M_Kcal = mean(`Kcal pro 100g`),
SD_Kcal = sd(`Kcal pro 100g`),
Min_Kcal = min(`Kcal pro 100g`),
Max_Kcal = max(`Kcal pro 100g`),
.by=c("category")) %>%
mutate_if(is.numeric,printnum) %>%
kbl(col.names = c("Category","M","SD","Min","Max")) %>%
kable_paper()
```
:::
# Lists
## Target Fact Items
```{r}
items %>%
select(ID_item,name,category,`g CO2 pro kg`,`Kcal pro 100g`,`Seeditems CO2` = seeding_CO2,`Seeditems Kcal` = seeding_Kcal) %>%
kbl(align = "c") %>%
column_spec(4,color = "white",background = spec_color(items$`g CO2 pro kg`)) %>%
column_spec(5,color = "white",background = spec_color(items$`Kcal pro 100g`,option = "D")) %>%
kable_styling(fixed_thead = T)
```
## Trivia Items
15 trivia facts will be shown during the seeding phase (`type = Post`) and 6 will be used in a 2AFC-recognition test in the final questionnaire (`type = Test`).
```{r}
trivia <- c("An average ear of corn has an even number of rows, usually 16",
"A watermelon consists of about 95 percent water.",
"Every German needs about 2,700 square meters of farmland for food supply.",
"Children see junk food advertisements an average of 27 times a day.",
"Approximately 500 million snails are eaten in France every year.",
"The largest cashew tree in the world covers an area of 8,500 square meters.",
"The price of food increased by 9 percent between August 2022 and August 2023.",
"Germans eat about 20 kilos of tomatoes per year.",
"Caffeine has a half-life of four to six hours.",
"Chia seeds contain five times more calcium than milk.",
"In Germany, peas were grown on 82,600 hectares of land in 2020.",
"In Germany, approximately 36,000 tons of pears were harvested in 2023.",
"Rosemary can be harvested after a germination period of about four weeks.",
"There are about 30mg of caffeine in a cup of green tea.",
"Farmers plant radishes with approximately 200 seeds per square meter.",
"The cultivation area of corn in Germany is around 472,200 hectares.",
"The German Nutrition Society recommends 400 grams of vegetables per day.",
"McDonald's sells 75 hamburgers per second.",
"Wheat requires about 500 liters of water per kilogram of dry matter.",
"China produced approximately 63 million tons of salt in 2019.",
"There are over 40 different types of kiwi.")
trivia_df <- data.frame(ID = 1:length(trivia),
fact = trivia,
type = c(rep("Post",15),rep("Test",6)))
trivia_df %>%
kbl(align = "c") %>%
kable_styling(fixed_thead = T)
```
# Plot
## CO2e per kg
::: {.panel-tabset}
## Overall
```{r}
ggplot(items,aes(x = fct_reorder(name,`g CO2 pro kg`),
y = `g CO2 pro kg`,
color = factor(seeding_CO2))) +
geom_point(size=p_size) +
geom_linerange(aes(ymax = `g CO2 pro kg`, ymin = 0),linewidth=lwd) +
facet_wrap(.~category,scales="free",nrow=2)+
labs(title = "",
x = "",
y = "",
color = "Seed Item") +
theme_nice() +
scale_color_manual(values = c("black","#22A884FF")) +
theme(axis.text.x = element_text(angle = 45,hjust = 1)) +
scale_y_continuous(expand = expansion(mult = c(0, 0.2)))
```
## Relative
```{r}
ggplot(items,aes(x = fct_reorder(name,`g CO2 pro kg`),
y = `g CO2 pro kg`,
color = factor(seeding_CO2))) +
geom_point(size=p_size) +
geom_linerange(aes(ymax = `g CO2 pro kg`, ymin = 0),linewidth=lwd) +
facet_wrap(.~category,scales="free",nrow=2)+
labs(title = "",
x = "",
y = "",
color = "Seed Item") +
scale_color_manual(values = c("black","#22A884FF")) +
theme_nice() +
theme(axis.text.x = element_text(angle = 45,hjust = 1)) +
scale_y_continuous(expand = c(0, 0), limits = c(0,28500))
```
:::
## Kcal per 100g
::: {.panel-tabset}
## Overall
```{r}
ggplot(items,aes(x = fct_reorder(name,`Kcal pro 100g`),
y = `Kcal pro 100g`,
color = factor(seeding_Kcal))) +
geom_point(size=p_size) +
geom_linerange(aes(ymax = `Kcal pro 100g`, ymin = 0),linewidth=lwd) +
facet_wrap(.~category,scales="free",nrow=2)+
labs(title = "",
x = "",
y = "",
color = "Seed Item") +
scale_color_manual(values = c("black","#22A884FF")) +
theme_nice() +
theme(axis.text.x = element_text(angle = 45,hjust = 1)) +
scale_y_continuous(expansion(mult = c(0, 0.2)))
```
## Relative
```{r}
ggplot(items,aes(x = fct_reorder(name,`Kcal pro 100g`),
y = `Kcal pro 100g`,
color = factor(seeding_Kcal))) +
geom_point(size=p_size) +
geom_linerange(aes(ymax = `Kcal pro 100g`, ymin = 0),linewidth=lwd) +
facet_wrap(.~category,scales="free",nrow=2)+
labs(title = "",
x = "",
y = "",
color = "Seed Item") +
scale_color_manual(values = c("black","#22A884FF")) +
theme_nice() +
theme(axis.text.x = element_text(angle = 45,hjust = 1)) +
scale_y_continuous(expand = c(0, 0), limits = c(0,800))
```
:::