Plot frequency of a value of 2 factors in the same plot in R <p>I'd like to plot the frequency of a variable color coded for 2 factor levels for example blue bars should be the hist of level A and green the hist of level B both n the same graph? Is this possible with the hist command? The help of hist does not allow for a factor. Is there another way around?</p> <p>I managed to do this by barplots manually but i want to ask if there is a more automatic method</p> <p><img src="https://i.stack.imgur.com/ZZkfj.png" alt="enter image description here"></p> <p>Many thanks EC</p> <p>PS. I dont need density plots</p>