title: Why am I getting this error while merging two dataframes?
body: <p>I am trying to merge two data frames by column names called "teams".</p>
  
  <p>My merge statement-</p>
  
  <pre><code>merge(RB,LB,by.x ="team")
  </code></pre>
  
  <p>The error I am getting is-</p>
  
  <blockquote>
    <p>Error in merge.data.frame(RB, LB, by.x = "team") : 'by.x' and 
    'by.y' 
     specify different numbers of columns.</p>
  </blockquote>
  
  <pre><code>#Create a data frame to store set of Right-Backs
        RB=data.frame(
         team=c("Liverpool",
       "Manchester United",
       "Chelsea","Atletico Madrid",
       "Juventus",
       "Real Madrid"),
       players=c("Trent-Alexandre Arnold",
          "Diogo Dalot",
          "Cesar Azpilicueta",
          "Keiran Trippier",
          "Danilo","Carvajal")
        ,stringsAsFactors = FALSE)
  
     #Create a data frame to store set of Left-Backs
      LB=data.frame(
      team=c("Manchester United",
       "Real Madrid",
       "Liverpool",
       "Chelsea",
       "Juventus",
       "Atletico Madrid"
       ),
       players=c("Luke Shaw","Marcelo","Andrew Robertson","Marcos Alonso","Alex Sandro", "Renan Lodi" ),
      stringsAsFactors = FALSE
       )
  </code></pre>