title: From tibble to txt or excel file in R
body: <p>Hi all: I am working with tibbles to summarise my data and now I have a problem. I need to send the data I have in a tibble to a partner in an excel or csv file format. The thing is that it requires the csv (or excel) file to be in a specific arrangement (no tidy data) so I was wondering if you can help me a little bit to, at least, have my tibble into a csv file in a way that would be easy to edit it in excel itself.  </p>
  
  <p>The tibble looks like this:</p>
  
  <pre><code># A tibble: 1,024 x 4
  # Groups:   Treatment [16]
     Treatment    Pressure  mean   std
     &lt;chr&gt;           &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt;
   1 "I Control "    0.     97.2  1.03
   2 "I Control "    0.689  94.1  1.35
   3 "I Control "    1.38   90.9  2.01
   4 "I Control "    2.07   89.5  2.20
   5 "I Control "    2.76   88.8  2.45
   6 "I Control "    3.45   87.6  2.88
   7 "I Control "    4.14   86.9  3.22
   8 "I Control "    4.83   83.9  5.53
   9 "I Control "    5.52   83.1  5.55
  10 "I Control "    6.21   81.9  6.24
  </code></pre>
  
  <p>I have 16 different values for the variable "Treatment". I would like to have a csv file that looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/5EkgD.png" alt="TableinExcel"></p>
  
  <p>As you can see from the picture, each value from the variable "Treatment" has 2 rows, one containing the values of the variable "mean" and the other containing the values from the variable "std". In the csv table each column would represent each different value from the variable "Pressure".</p>
  
  <p>Any idea or suggestion? Thanks in advance for the time.</p>