I have a dataframe like:
I would like to obtain a barplot with, for each bin, two bars (up and down) and the text of upIDX above the up's bars and text of downIDX above the down's bars like
On ggplot2, I could generate the graph with the two bars for each bin but I wasn't able to add the labels above the bars. Here is the script I wrote:
df3<-melt(df3,id='bin')
ggplot(df3,aes(x=factor(df3$bin,levels=df3$bin),y=df3$value,fill=df3$variable))+
geom_bar(stat='identity',position = 'dodge')+
coord_flip()
Can someone could help me?



dput(df3)and add the result to your post instead of showing a screenshot of your data. (The first one can easily be copied and pasted into an R session to reproduce the data set)