title: How do you manually add linetype legend in ggplot?
body: <p>I have a plot that has two types of lines, but I cant get it to show up in the legend like the colours do. My datasets look like</p>
  <pre><code>Role &lt;- LETTERS[1:3]
  df1 &lt;- data.frame (totalFemByLevel = c(104,23,9),
                     totalMalByLevel = c(48,30,12),
                     Role)
  df2 &lt;- data.frame (totalFemByLevel = c(100,30,6),
                     totalMalByLevel = c(44,25,10),
                     Role)
  </code></pre>
  <p>With one being from 2016 and the other being from 2019, both structured the same.</p>
  <pre><code>CompareTotalPlot &lt;- function(df1, df2, title) {   Plot &lt;- ggplot(data
  = df1, aes(x = factor(Role), group = 1))+  #female=red, male = steelblue
      geom_line(aes(y=totalFemByLevel, col = &quot;red&quot;), size = 1.5) +
      geom_point(aes(y=totalFemByLevel, col = &quot;red&quot;), size = 7)+
      geom_text(aes(y=totalFemByLevel, label = totalFemByLevel))+
      
      geom_line(aes(y=totalMalByLevel, col =&quot;steelblue&quot;), size = 1.5) +
      geom_point (aes(y=totalMalByLevel,col = &quot;steelblue&quot;), size = 7)+
      geom_text(aes(y=totalMalByLevel, label = totalMalByLevel))+
      scale_linetype_manual(name = &quot;Year&quot;,
                            values = c(1,2), 
                            labels = c(&quot;2019&quot;, &quot;2016&quot;))+ #l
      scale_colour_manual(name = &quot;Gender&quot;,
                          labels = c(&quot;Women&quot;,&quot;Men&quot;),
                          values = c(&quot;red&quot;,&quot;steelblue&quot;))+
      labs(x= &quot;Level&quot;,
           y= &quot;Total&quot;,
           title = title
      )
      
       Plot &lt;- Plot+geom_line(data=df2, aes(y=totalFemByLevel, col = &quot;red&quot;), size = 1, linetype = 2)+
         geom_line(data=df2, aes(y=totalMalByLevel, col = &quot;steelblue&quot;), size = 1, linetype = 2 )
      
          }
  </code></pre>
  <p><img src="https://i.stack.imgur.com/i8zrF.png" alt="plot" /></p>
  <p>This is the plot my current code outputs, Im happy with everything except for the legend.</p>