Hi everybody, I need help with my bar plot (for my thesis). I wanted to make it a plot according to the sequence of the data, but instead, it was arranged from lowest to highest. Thank you so much.
library(readr)
library(ggplot2)
library(tidyverse)
library(dplyr)
library(reshape2)
library(wesanderson)
library(rstatix)
library(ggpubr)
library(plyr)
library(datarium)
library(summariser)
library(ggrepel)
library(ggprism)
library(patchwork)
library(magrittr)
AptaC10<-data.frame(Purification=c("HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC","HPLC",
"Original","Original","Original","Original","Original","Original","Original","Original","Original","Original","Original","Original","Original","Original","Original","Original","Original","Original"),
time=c("48","48","48","48","48","48","48","48","48","96","96","96","96","96","96","96","96","96","48","48","48","48","48","48","48","48","48","96","96","96","96","96","96","96","96","96"),
con=c("0","5","10","25","50","100","250","500","750","0","5","10","25","50","100","250","500","750","0","5","10","25","50","100","250","500","750","0","5","10","25","50","100","250","500","750"),
bgrowth=c("0.6571630","0.6735407","0.6633407","0.6759000","0.7049111","0.7174444","0.6808407","0.6397963","0.6485444","0.6509333","0.6478444","0.6346000","0.6307741","0.6254704","0.5887815",
"0.5769222","0.5469444","0.5809481","0.6571630","0.6887704","0.6746222","0.6781222","0.7078963","0.7092037","0.6641481","0.6258000","0.6446926","0.6509333", "0.6690037","0.6414148","0.6352926","0.6206370",
"0.5787037","0.5591593","0.5363593","0.5673148"))
ggplot(data = AptaC10, mapping = aes(x=time, y=bgrowth, fill=con)) +
geom_bar(stat="identity", position = "dodge") +
facet_grid(~Purification)+
theme_bw()+
scale_fill_manual(name = "Concentration\n(ppm)",
values = c("0" = "black", "5" = "red", "10"= "purple",
"25"="blue", "50"= "darkgreen", "100"= "orange",
"250"= "skyblue", "500"="maroon", "750"="violet"))