title: Construct a new Dataframe and get the statistical summary in R Studio
body: <p>I want to construct a new table and get the statistical summary from the old table by each group. 
  This is what I have:</p>
  
  <pre><code>df &lt;- data.frame(
    number =  c(3,4,5,6,7,3,5,6,7,6),
    group= c("red", "yellow", "green", "green", "yellow", "yellow", "red", "red", "red", "green")
  )
  </code></pre>
  
  <p>Please see the picture for the dataframe I want as result. Thanks ahead!</p>
  
  <p><a href="https://i.stack.imgur.com/Hx4ql.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hx4ql.png" alt="enter image description here"></a></p>