Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Combine dodge and stack position in the same bar graph with ggplot2

$
0
0

I need to represent some data in a very specific way. Right now I have a factor "treatment" with 8 levels, and then for each level, 4 different values obtained in the experiment (let's call it "type" factor with levels c("a", "b", "c", "d"). I would like to represent a graph where I have all "treatment" levels with position dodge for "type""a" and "b", and then I would like to stack "c" and "d" together.

I've tried to implement this solution with no success.

What I have enter image description here

What I want enter image description here

I'm pretty sure it's not gonna be possible to have it exactly like I need, but I can accept a close enough try.

Thanks! J.


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>