title: Merging datasets in R
body: <p>I am trying to merge two datasets for table a and table b. It is for longitduinal purposes where I have created time invariant variables such as sex and education type.</p>
  
  <pre><code>joinedaandb &lt;- full_join(tbl_df(tablea), tbl_df(tableb), by = "pidp") 
  </code></pre>
  
  <p>The unique identifier is pidp. There are a bunch of variables I was expecting to match up such as sex, edtype and age into one variable but instead it has created a sex.x variable and a sex.y variable.</p>
  
  <pre><code>pidp        &lt;dbl&gt; 280165, 541285, 541965, 665045, 956765, 987365, 1558565, 1833965, 229…
  $ sex.x       &lt;fct&gt; female, male, female, male, male, female, female, male, male, female,…
  $ edtype.x    &lt;fct&gt; proxy, proxy, proxy, inapplicable, proxy, proxy, at higher education …
  $ age.x       &lt;fct&gt; 32, 25, 23, 29, 56, 21, 18, 46, 36, 17, 29, 22, 28, 57, 20, 33, 27, 6..
  </code></pre>
  
  <p>A bit further down these y variables appear.</p>
  
  <pre><code>$ sex.y      : Factor w/ 7 levels "missing","inapplicable",..: 7 6 NA 6 NA NA NA 6 6 NA ...
   $ edtype.y   : Factor w/ 10 levels "missing","inapplicable",..: 3 3 NA 2 NA NA NA 3 3 NA ...
   $ age.y      : Factor w/ 91 levels "missing","inapplicable",..: 23 16 NA 20 NA NA NA 37 26 NA ...
  </code></pre>
  
  <p>What does this mean? And how do I get it so that it matches the variables such as sex from tablea and tableb into a singular variable in the new dataframe.</p>
  
  <p>Cheers</p>