title: Merging two dataframes on one matching variable and retaining only one value for other disjoint variables
body: <p>I have two dataframes I need to merge. The dataframes share all of the same columns. I am merging based on one shared variable, worker_ID. However, the other variables are often disjoint: one dataframe will have an "NA" and the other will have another value for a given variable. How can I merge in such a way that the output only retains the non-NA value?</p>
  
  <pre><code>x = worker_ID Var_1 Var_2 Var_3
      1         33    NA    NA
      2         NA    46    NA
  
  y = worker_ID Var_1 Var_2 Var_3
      1         NA    75    NA
      2         NA    NA    66
  
  z &lt;- merge(x,y,by="worker_ID", all = TRUE)
  </code></pre>
  
  <p>This method does not work because instead of my desired output, z, I get a dataframe with two columns for each variable (one for the value of the variable in x and another for y). My desired output is z. </p>
  
  <pre><code>z = worker_ID Var_1 Var_2 Var_3
      1         33    75    NA
      2         NA    46    66
  </code></pre>
  
  <p>How can I tell R to let any non-NA entries supersede NA ones?</p>