How to draw boxplot graph using R?

How to draw boxplot graph using R?


install.packages("readr")
library(readr)

github="https://raw.githubusercontent.com/agronomy4future/raw_data_practice/main/Grain%20area%20for%20two%20genotypes.csv"

dataA= data.frame(read_csv(url(github), show_col_types= FALSE))
library(ggplot2)
ggplot(data=dataA, aes(x=Genotype, y=Area, group=Genotype, color=Genotype)) +
  geom_boxplot() +  
  scale_color_manual(values = c("blue", "red")) +
  scale_y_continuous(breaks = seq(0, 30, 10), limits = c(0, 30)) +
  labs(x="Genotype", y="Grain area (mm2)") +
  theme_classic(base_size= 15, base_family = "serif") +
  theme(legend.position="none",
        legend.title=element_blank(),
        legend.key=element_rect(color="white", fill="white"),
        legend.text=element_text(family="serif", face="plain",
                                   size=15, color="black"),
        legend.background= element_rect(fill="white"),
        axis.line= element_line(linewidth= 0.5, colour= "black")) +
  windows(width=5.5, height= 5)

Leave a Reply

If you include a website address in the comment section, I cannot see your comment as it will be automatically deleted and will not be posted. Please refrain from including website addresses.