I'm trying to reorder the bars in my chart, some of which have duplicated category names, but some of them won't reorder. What am I doing wrong?
Sample data:
dyndom1 <- data.frame(Structure=c("T1R1vftd.web8", "6N4X.pdb", "T1R1vftd.web8", "T1R1vftd.web11", "6N52.pdb"),
Rotation_angle = c(31.4, 29, 4.9, 16.1, 28.1),
#Translation = c(0.5, 0.4, -0.3, 1.2),
Closure = c(99.9, 99.4, 98.9, 98.5, 96.7))
dyndom1
dyndom1$Structure <- fct_reorder(dyndom1$Structure, dyndom1$Closure)
ggplot(dyndom1, aes(fill=Structure, y=Closure, x=Structure)) +
geom_bar(position="dodge", stat="identity") +
coord_flip()