0

I have a CSV data file with 4 columns. below you can see the screen shot of that.

enter image description here

I am trying to visualize my data and make a bar for each Pos(x axis). I used the following code to do so.

p <-ggplot(data, aes(pos, log))
p +geom_bar(stat = "identity", aes(fill = group))

and got the bar plot but the order of items (positions) at the x axis is not like my data file but they has to be in the same order.

enter image description here

how can I make a bar plot in which the items on the x axis have the same order as my file?

and here is the screen of dput(data):

enter image description here

0 Answers0