title: ggplot2: applying width of line to the legend key
body: <p>Considering the data.frame "dfc":</p>
  
  <pre><code>dfc &lt;- structure(list(lag = c(-5L, -4L, -3L, -2L, -1L, 0L, 1L, 2L, 3L, 
         4L, 5L, -5L, -4L, -3L, -2L, -1L, 0L, 1L, 2L, 3L, 4L, 5L), variable = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("var1", "var2"), class = "factor"), 
  value = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0.6, 1.2, 1.8, 
  2.4, 3, 3.6, 4.2, 4.8, 5.4, 6, 6.6), size = c(2, 2, 2, 2, 
  2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)), .Names = c("lag", 
  "variable", "value", "size"), row.names = c(NA, -22L), class = "data.frame")
  </code></pre>
  
  <p>Which looks like:</p>
  
  <pre><code>head(dfc)
    lag variable value size
  1  -5     var1     1    2
  2  -4     var1     2    2
  3  -3     var1     3    2
  4  -2     var1     4    2
  5  -1     var1     5    2
  6   0     var1     6    2
  </code></pre>
  
  <p>I would like to plot "value" against "lag" with different line styles (depending on "variable) and widths (depending on "size"). I achieved with this piece of code:</p>
  
  <pre><code>ggplot(dfc) +
  geom_line(aes(x = lag, y = value, linetype = variable, size = size)) +
  scale_size(range=c(1, 2), guide=FALSE) +
  scale_linetype_manual(values = 1:2, labels = c("Name of var1    ", "Name of var2")) +
  theme(legend.title = element_blank(), legend.position = "bottom",
        legend.direction = "horizontal")
  </code></pre>
  
  <p>Giving this plot:
  <img src="https://i.stack.imgur.com/jSHks.png" alt="enter image description here"></p>
  
  <p>But I cannot figure out how, at the same, to change the size of the line inside the legend, accordingly, and to keep the renaming.</p>