I want to use the function geom_bar on my data that look like that:

ID        Lenght          facies

rad1          8                   rad

placou1    12                 placou

rap1           24                 rap

rad2           54                 rad

placou2      45                 placou

......

I want to have only one barplot that compiled the lenght of each ID, in the order that they appear in the data, but I want to use the variable "Habitat" for the fill color.

If I do: 

ggplot(ETI3, aes(x="", y=Longueur, fill = ID,color=habitat)) +

geom_bar(width = 10, stat = "identity"

I have just the boarder of boxes colored by "habitat", not the inside. See in attach file.

So, someone have an idea how can I colored my boxes by habitat?

Thanks in advance

More Emmanuel Corse's questions See All
Similar questions and discussions