I am plotting a barplot using
geom_bar() function in R.
I have some the recoreds which share the same x-axis identifiers.
geom_bar() did merge all values that shared the same x-axis identifiers.
Like the following example.
library("ggplot2") df <- data.frame(x = c("a","a","b","c","d","e"), y = c(5,5,5,5,5,5), stringsAsFactors = FALSE) ggplot(df, aes(x, y)) + geom_bar(stat = "identity")
The erroneous graph is displayed below.
The highest bar means the sum of multiple y-values shared same x-axis names.
Anyone else could help me to solve this problem? Thanks.