title: Sorting output of dplyr::summarise
body: <p>My data looks like this:</p>
  
  <p><em>(sassign is the data.frame that holds the data)</em></p>
  
  <pre><code>head(sassign %&gt;% select(child,youth,cook,do_it))
    child youth cook do_it
  1     3     2    2     0
  2     0     1    0     1
  3     0     0    2     0
  4     0     0    0     0
  5     0     0    1     0
  6     0     1    0     0
  </code></pre>
  
  <p>My objective is to find total # of people who bought child books, youth books, cook books and do_it books.</p>
  
  <p>So, here's what I did:</p>
  
  <pre><code>sassign %&gt;%  summarise( sumchild=sum(child),sumyouth=sum(youth),sumcook=sum(cook),sumdo_it=sum(do_it)) 
  </code></pre>
  
  <p>Here's the output I got:</p>
  
  <pre><code>  sumchild sumyouth sumcook sumdo_it
  1    42723    19549   46830    23153
  </code></pre>
  
  <p><strong>Question 1:: This solves my purpose, but is there anyway I can get a sorted column-wise output? Here's what I got from Stata:</strong></p>
  
  <pre><code>    --------------------------------------------------------------
      | Total Std. Err. [95% Conf. Interval]
      -------------+------------------------------------------------
      cook | 46830 265.0706 46310.46 47349.54 
     child | 42723 250.4739 42232.07 43213.93
      do_it | 23153 171.2552 22817.34 23488.66
      youth | 19549 152.7226 19249.66 19848.34
  </code></pre>
  
  <p>As you can see above, STATA output is nicely sorted from top to bottom. </p>
  
  <p><strong>Question 2:: Is there anyway I can also include SD, and CI as STATA shows?</strong></p>
  
  <p><strong>Questions 3:: Is there anyway I can sort on SD, or CI instead of sum in R? I looked at describe function, but I wasn't sure so I thought of asking them here itself.</strong></p>
  
  <p>I am transitioning from Stata to R, so I would be grateful for any help I can get. I also looked through other posts on SO, but most of them deal with ordering when using group_by.</p>
  
  <p>Thanks</p>