title: class "By" into dataframe in R
body: <p>I'm using by() to evaluate a function by factors in my dataframe, but I need to use the results in a table form.</p>
  
  <p>I've seen a use of as.data.frame.table to get a "By" class object into a data frame, but I'm not sure if this only works when the number of factors employed in the by() function is the same as the length of the "by" output. Using as.data.frame.table I get the following error</p>
  
  <p>"...arguments imply differing number of rows: 10, 33"</p>
  
  <p>Is there another way of doing this? 
  Can tapply be used instead of by() to get a different output class?</p>
  
  <p>btw, I'm using by() to convert my data into a frequency table and then regroup by standard bins</p>
  
  <pre><code>BT_by &lt;- by(BT_H, BT_H$Tax_pp, function(BT_H) hist(rep.int(BT_H$Altitude, BT_H$Count), breaks = seq(0,6600,200), plot = FALSE)$counts)
  </code></pre>
  
  <p>Any help would be appreciated. </p>