Hi @Coolaline13,
Take a look at this then:
# Load libraries ----------------------------------------------------------
library("tidyverse")
# Set example data --------------------------------------------------------
set.seed(9481)
d <- tibble(TF1 = runif(n = 3, min = 0, max = 3),
TF2 = runif(n = 3, min = 0, max = 3),
TF3 = runif(n = 3, min = 0, max = 3),
TF4 = runif(n = 3, min = 0, max = 3))
# Wrangle data ------------------------------------------------------------
d <- d %>%
pivot_longer(cols = everything(),
names_to = "mutant",
values_to = "amount") %>%
mutate(is_TF3 = case_when(mutant == "TF3" ~ "TF3",
TRUE ~ "not_TF3"))
# Visualise ---------------------------------------------------------------
my_plot <- d %>%
ggplot(aes(x = is_TF3, y = amount, fill = is_TF3)) +
geom_boxplot() +
scale_fill_manual(values = c("pink", "purple")) +
labs(title = "Flocculation Level of Mutants",
x = "Mutant Transcription Factors",
y = "Degree of Flocculation")
# Save visualisation ------------------------------------------------------
ggsave(filename = "Flocculation_Level_of_Mutants.png",
plot = my_plot, width = 10, height = 6, dpi = 72)
Yielding
Hope it helps