title: Create a master data set using another data set (Kind of relation ship)
body: <p>I have two csv data X and Y</p>
  
  <p>X - Is a Master Data with columns (id, name, dept)</p>
  
  <p>Y- Kind of reference Data with columns (dept, fees)</p>
  
  <pre><code>X.csv
  id  name    dept
  1   a       IT
  2   b       CS
  3   ab      Mech
  4   bc      IT
  5   af      Mech
  6   Hg      CS
  
  Y.csv
  dept    fees
  IT      1111
  CS      20
  Mech    100
  </code></pre>
  
  <p>I want output like below - In both the CSV 'dept' column is common with help of that, we have to combine this two data set and create single data set with these columns (id, name, dept, fees)</p>
  
  <pre><code>XY.csv
  id  name    dept    fees
  1   a       IT      1111
  2   b       CS      20
  3   ab      Mech    100
  4   bc      IT      1111
  5   af      Mech    100
  6   Hg      CS      20
  </code></pre>
  
  <p>I tried below code, but ended up in error- I dont know how to solve this. </p>
  
  <pre><code>&gt; m=merge(X,Y,by="c")
  Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column
  </code></pre>