I have a problem with the scale order on the x axis.

My input file has the correct order after merging and matching two dataframes.
#data
Eisenberg <- data.frame(scale_hyd = c(0.62, 0.29, -0.9, -0.74, 1.19, 0.48, -0.4,
1.38, -1.5, 1.06, 0.64, -0.78, 0.12, -0.85,
-2.53, -0.18, -0.05, 1.08, 0.81, 0.26),
aa = c('A','C','D','E','F','G','H','I','K','L','M','N',
'P','Q','R','S','T','V','W','Y'))
hydroph <- data.frame(position_aa = c("-10", "-9", "-8", "-7", "-6", "-5", "-4",
"-3", "-2", "-1", "0", "1", "2", "3", "4",
"5", "6", "7", "8", "9", "10", "11", "12",
"13", "14"),
aa = c("C","V","Q","W","K","N","A","Y","A","L","C","W","L",
"D","C","I","L","S","A","L","V","H","S","E","E"))
#combining data
res <- merge(Eisenberg, hydroph)
res1 <- res[match(hydroph$position_aa, res$position_aa), ]
view(res1)
#visualisation of data
ggplot(res1, aes(x=position_aa, y=scale_hyd)) +
geom_boxplot() +
labs(x="Amino acid position", y="Eisenberg scale", title="Hydrophobicity") +
theme_bw() +
theme(legend.position="none") +
geom_dotplot(binaxis="y", stackdir="center", fill="black")
I would be grateful if you could help me put the right order of position_aa on the x axis:
-10 -9 -8 ... 14
instead of: -1 -10 -2...
As suggested I added res1$position_aa <- as.numeric(res1$position_aa)

