title: In aggregate: sum not meaningful for factors
body: <p>I am trying something that should be simple, any hint on what is going on is very welcomed.</p>
  
  <p>I have a large data frame with country imports from some municipalities. For some countries I have 2 entries. I want to sum the imports from each municipality and having a unique row for each country. I am using the <code>aggregate</code> function. For example (I include a small part of the data frame):</p>
  
  <pre><code>municipalities&lt;-c("country",1100056, 1100106,1100205,1100304,1200104,1200252)
  c1&lt;-c("Afghanistan",2,34,23.4,5,0,0)    
  c2&lt;-c("Afghanistan",0,20,11.1,5.4,2,0)    
  c3&lt;-c("Albania",12,120,11.4,5.1,12,10)    
  c4&lt;-c("Albania",0,40,61.1,65.4,652,2)
  df&lt;-as.data.frame(rbind(municipalities,c1,c2,c3,c4))
  </code></pre>
  
  <p>Basically I am trying </p>
  
  <pre><code>df&lt;-df[-1,]    
  aggregate(df[,2:7],list(df[,1]),sum)
  </code></pre>
  
  <p>but I receive a message:</p>
  
  <pre><code>Error in Summary.factor(c(4L, 1L), na.rm = FALSE) : 
    sum not meaningful for factors
  </code></pre>
  
  <p>I have tried to force the <code>df</code> to be numeric, declared the characters as characters etc. but nothing seems to help.</p>