title: dcast error: `Error in match(x, table, nomatch = 0L)`
body: <p>I have a dataframe called <code>df</code> that looks something like this...</p>
  
  <pre><code>"ID","ReleaseYear","CriticPlayerPrefer","n","CountCriticScores","CountUserScores"
  "1",1994,"Both",1,5,283
  "2",1994,"Critics",0,0,0
  "3",1994,"Players",0,0,0
  "4",1995,"Both",3,17,506
  "5",1995,"Critics",0,0,0
  "6",1995,"Players",0,0,0
  "7",1996,"Both",18,163,3536
  "8",1996,"Critics",2,18,97
  "9",1996,"Players",3,20,79
  </code></pre>
  
  <p>I want to flip the data frame around so the columns are like this:</p>
  
  <p><code>"ReleaseYear","Both","Critics","Players"</code></p>
  
  <p>The values for columns <code>Both',</code>Critics<code>and</code>Players<code>would be the</code>n` for each.</p>
  
  <p>When I try running this...</p>
  
  <pre><code>require(dcast)
  chartData.CriticPlayerPreferByYear &lt;- dcast(
      data = df,
      formula = ReleaseYear ~ CriticPlayerPrefer,
      fill = 0,
      value.var = n
  )
  </code></pre>
  
  <p>... I get this error:</p>
  
  <pre><code>Error in match(x, table, nomatch = 0L) : 
    'match' requires vector arguments
  </code></pre>
  
  <p>What is the problem here? How do I fix it?</p>