title: '. ~' operators in R
body: <p>I am very new to R - I am going through a script that includes the following:</p>
  <pre><code>new_data&lt;-aggregate(. ~ old_data$Company+old_data$Financial_Year, data=old_data, sum)
  </code></pre>
  <p>I understand that this is what in pandas would be a groupby().sum() where everything is grouped at the company and financial year level - is that correct? is '.~' meaning all the other columns in old_data other than Company and Financial_Year?</p>
  <p>Also if the command were to throw the error</p>
  <pre><code>Error in FUN(X[[i]], ...) : invalid 'type' (character) of argument
  </code></pre>
  <p>I imagine it is because some of the other columns are not numeric?</p>
  <p>thanks in advance!</p>