title: Combining two data frames in single ggplot with facet wrap with different factor names?
body: <p>Say I have a df1 (incidents) and a df2 (records).</p>
  <pre><code>df1 &lt;- data.frame(date = c(&quot;2021-07-01&quot;,&quot;2021-07-09&quot;,&quot;2021-07-04&quot;,&quot;2021-07-05&quot;), value = c(200, 250, 123, 400), machine=c('abc1', 'abc2', 'abc3', 'abc4'),sprocket=c('boop', 'blip', 'blip', 'boop'))
  
  
  df2 &lt;- data.frame(date2 = c(&quot;2021-07-02&quot;,&quot;2021-07-03&quot;,&quot;2021-07-06&quot;,&quot;2021-07-08&quot;), record=c('record1', 'record2', 'record3', 'record4'), robot = c('abc2', 'abc42', 'abc1', 'abc3'))
  </code></pre>
  <p>So I want to plot x = date and y = value by sprocket for df1. Then for df2, I want to OVERLAY the records by machine, regardless of sprocket, on the correct date and machine.</p>
  <p>Im having trouble getting the machines to line up without renaming 'robot' to 'machine' for df2, but I feel like there should be a way of specifying 'robot' = 'machine' or something in the facet_wrap.</p>
  <p>Here is more of what I'm actually working with:</p>
  <pre><code>p3 &lt;-ggplot() + 
    geom_point(df1, mapping = aes(x = date, y = value, color = value&gt; 1.5 | value&lt; -1.5)) + 
    scale_colour_manual(values = c(&quot;black&quot;, &quot;red&quot;)) +
    facet_wrap(vars(machine),ncol=5)+
    facet_grid(sprocket~ machine) +
    geom_hline(yintercept = 1.5, linetype = &quot;dashed&quot;,color = &quot;red&quot;)+
    geom_hline(yintercept = -1.5, linetype = &quot;dashed&quot;,color = &quot;red&quot;)+
    theme_classic() + 
    ylim(-30, 30)+
      scale_x_date(breaks = seq(as.Date(&quot;2021-07-01&quot;), max(df1$date), by=&quot;3 months&quot;), date_labels =  &quot;%b&quot;) +
    xlab(&quot;1974&quot;) +
    ylab(&quot;% blahblah&quot;)+
    
  #here's the records bit
    geom_segment(df2, mapping = aes(x=date2, xend=date2, y=-30, yend=30), linetype = 'dashed') +
    geom_point()+
    facet_wrap(.~robot, ncol=5)
  </code></pre>
  <p>What I want to do is plot df2 on top of the existing df2 graph seamlessly without renaming variables. I was able to do this mostly by renaming 'robot' to 'machine' for df2 but I want to know how to do it without that. Im still missing retaining the sprocket facet_grid part:</p>
  <p><a href="https://i.stack.imgur.com/xmELb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xmELb.png" alt="Desired graph" /></a></p>