title: Calculate ellipse eccentricity using dplyr from ellipse points in dataframe
body: <p>I'm trying to calculate the eccentricity of ellipses contained in the following file:</p>
  
  <p><a href="https://www.dropbox.com/s/cqwghg7uvj1xl4d/ellipses.csv?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/cqwghg7uvj1xl4d/ellipses.csv?dl=0</a></p>
  
  <p>It's organized as 100 points that define 100 ellipses of each group. Groups are A, B, C ... And each ellipses of a group is denoted in the "rep" column.</p>
  
  <p>I thought I might be able to do this using dplyr, but I'm having trouble because I am new to dplyr. I found on this <a href="https://stackoverflow.com/questions/42101065/finding-the-parts-of-the-ellipse-from-my-data-in-r">post</a> how to calculate eccentricity from points of an ellipse. The steps are: calculate the centroids of the ellipse, find the semi-major and semi-minor axis, and then compute the eccentricity.</p>
  
  <p>I understand how to group_by, but I am not sure how to work up the summarise part to go through the multi-step calculation. Here is what should be calculating the centroids.</p>
  
  <pre><code>ellipse_df &lt;- read.csv("~/Desktop/ellipses.csv")
  ellipse_df %&gt;%
  group_by(group, rep) %&gt;%
  summarise(
  
  mean(iso1),mean(iso2))
  </code></pre>
  
  <p>Obviously this is not much. I'd like to have the output keep the grouping of the data, so I get 100 values for eccentricity for each group. </p>
  
  <p>Thanks for your help! </p>