I have a Table and I generated a Hallmark Cleveland plot to visualize the enrichment scores before and after applying my software. But how can I rearrange the order of my plot to look like this ? I was thinking to sum up scores of all statuses in each hallmark and plot the hallmarks in a descending order based on the sum of status scores. But I am not sure how to do it. T
The code is as follows
library(ggplot2)
ggplot(Table, aes(Table$`Enrichment Scores`, Table$Hallmarks)) +
geom_point(aes(color=Table$Status)) +
ggtitle("Hallmarks") + geom_line(aes(group = Table$Hallmarks)) +
geom_vline(xintercept = ES_cutoff, color = "blue", linetype = "dashed", size = 1)
Using a little made-up data, you could use
fct_reorder
to reorder thehallmarks
based on thedistance
of the scores for that hallmark from the cut-off.Created on 2022-06-08 by the reprex package (v2.0.1)