R ggplot2 geom_line position dodge
<p>I can't find an example on how to do this. I'm trying to draw lines using <code>geom_line</code> but dodge the overlapping elements, and it doesn't seem to work. </p>

<p>Here is my data: </p>

<pre><code>&gt; sa
    id ep type grp variable value
 1:  1  1 typ1   1       st     1
 2:  1  2 typ1   2       st    60
 3:  1  3 typ1   3       st   120
 4:  1  1 typ2   4       st    20
 5:  1  2 typ2   5       st    60
 6:  2  1 typ1   6       st     1
 7:  2  2 typ1   7       st    80
 8:  2  3 typ1   8       st   170
 9:  2  1 typ2   9       st    10
10:  2  2 typ2  10       st    60
11:  2  3 typ2  11       st   120
12:  1  1 typ1   1       en    50
13:  1  2 typ1   2       en   100
14:  1  3 typ1   3       en   150
15:  1  1 typ2   4       en    40
16:  1  2 typ2   5       en   100
17:  2  1 typ1   6       en    40
18:  2  2 typ1   7       en   150
19:  2  3 typ1   8       en   200
20:  2  1 typ2   9       en    50
21:  2  2 typ2  10       en    90
22:  2  3 typ2  11       en   190
</code></pre>

<p>Here is my simple code trying to dodge overlapping values for <code>typ1</code> and <code>typ2</code> </p>

<pre><code> ggplot(sa,aes(x=value,y=id,group=grp,color=type)) + geom_line(size=6,position="dodge")
</code></pre>

<p><a href="https://i.stack.imgur.com/xVTFo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xVTFo.png" alt="plot I get"></a></p>

<p>This is what I see. How do I dodge the overlapping bars?</p>