title: unimplemented type 'list' in 'listgreater' error in R when using cast
body: <p>I'm trying to cast a simple dataframe using R.  It's been melted using melt(). Here's the structure of the melted dataframe:</p>
  <pre><code>&gt; str(pMaster)
  'data.frame':   172 obs. of  7 variables:
   $ Year          : chr  &quot;1788&quot; &quot;1792&quot; &quot;1796&quot; &quot;1800&quot; ...
   $ TotalVotesCast: num  43782 28579 66840 67280 143028 ...
   $ result        : chr  &quot;RunnerUp&quot; &quot;RunnerUp&quot; &quot;RunnerUp&quot; &quot;RunnerUp&quot; ...
   $ candidate     : chr  &quot;No candidate&quot; &quot;No candidate&quot; &quot;Thomas Jefferson&quot; &quot;Aaron Burr&quot; ...
   $ party         : chr  NA NA &quot;D-R&quot; &quot;D-R&quot; ...
   $ PopPct        : num  0 0 46.5 38.6 27.2 ...
   $ PopVotes      : num  0 0 31115 25952 38919 ...
  </code></pre>
  <p>And here's what I get when I try to cast it:</p>
  <pre><code>&gt; cast(pMaster, Year ~ result, value = &quot;PopVotes&quot;, fun.aggregate = sum)
  Error in order(Year = c(&quot;1788&quot;, &quot;1788&quot;, &quot;1792&quot;, &quot;1792&quot;, &quot;1796&quot;, &quot;1796&quot;,  : 
    unimplemented type 'list' in 'listgreater'
  </code></pre>
  <p>Nothing I try seems to solve the error I'm getting.  I am able to cast things if I use a variable other than Year, but I can't see anything about the data in the Year column that looks like it could be causing trouble.  I've done some searching here on SO and elsewhere, but was surprised to see there isn't that much on whatever &quot;listgreater&quot; is.   Any ideas, anyone?  Thanks for any help.</p>