title: ggplot2 assigning aesthetics falsely
body: <p>I am creating plots with ggplot2 and for some reason the function is acting really weirdly.</p>
  
  <p>I have a dataframe <em>df</em>, and I want to visualize several columns.</p>
  
  <p>Any dataframe seems to work fine. I have generated this dummy dataframe.</p>
  
  <pre class="lang-r prettyprint-override"><code>df &lt;- data.frame(Date = seq.Date(as.Date.character("2019-01-01"), by = 1, length.out = 10), 
                   Value = rnorm(10), 
                   Foo = rnorm(10))
  </code></pre>
  
  <p>So what I do is</p>
  
  <pre class="lang-r prettyprint-override"><code>  library(ggplot2)
    gg &lt;- ggplot(df, aes(x = Date)) + geom_line(aes(y = Value, color = "Value", linetype = "Value"))
    gg &lt;- gg + geom_line(aes(y = Foo, color = "SomeWord", linetype = "SomeWord"))
    gg &lt;- gg + scale_color_manual(name="Legend", 
        breaks=c("Value", "SomeWord"), values=c("steelblue", "firebrick")) + 
      scale_linetype_manual(name="Legend", 
        breaks=c("Value", "SomeWord"), values=c("solid", "twodash"))
    gg
  </code></pre>
  
  <p>Normally, ggplot2 would now correctly assign color <em>steelblue</em> and linetype <em>solid</em> to the column <em>Value</em>, while assigning <em>firebrick</em> and <em>twodash</em> to the <em>Foo</em> column, which I assigned the name <em>SomeWord</em> to. However, depending on what I choose for the name, ggplot assigns the colours and linetypes in the wrong way. For example, using "Test1" as a name seems to work just fine, but "Einschritt" causes ggplot2 to throw my entire ruleset out of the window.</p>
  
  <p>I have tried googling this, but have not found any clue on why ggplot seems not to accept some names, while others are just fine. I would also like to use Hyphens in the color and linetype reference name which I assume <em>might</em> be a problem.</p>
  
  <p>Edit: As an example, I have just tried replicating this on my dummy data frame. Using the code posted above, when I use the following names, the linetype and colour are matched falsely:  </p>
  
  <ul>
  <li>"Value" for column "Value", anything for column Foo.  </li>
  <li>"Ein-Schritt-Prognose" for column "Value", anything for column Foo.  </li>
  <li>"SomeWord" for column "Value", anything for column Foo.</li>
  </ul>
  
  <p>However, when I switch to something like:</p>
  
  <ul>
  <li>"ABD" for column Value, anything for column Foo.</li>
  </ul>
  
  <p>then they are matched correctly.</p>