I am trying the following plotting.
I have this data set:
Pathway Value Col.Code
AKTSig 1 r
HRAS 2 r
Lbind 3 h
GPCRact 4 r
ACHsig 5 h
ACEest -2 r
MRNAspl -3 h
Notch -4 h
Delta -5 r
Sonic -6 r
I would like to plot a graph that has these columns with pathway along the x axis, value up the y axis and the columns coloured by the Col.Code column. I have tried geom_col() from ggplot2 but this always rearranges the columns into a random order i.e. not highest value to most negative. I have also tried geom_bar() but this creates counts for the pathways and doesn't plot what I have described above.
You can use this:
library(dplyr)
ggplot(data,aes(x=reorder(Pathway,-Value),y=Value,fill=Col.Code))+geom_bar(stat='identity')