title: Create the mean for all possible combinations of 5 different variables
body: <p>I have a data set with 5 different variables (e.g., a, b, c, d, and e). I want to have simple code (preferably with the tidyverse) that allows me to take the mean for each possible combination of the variables. For example, the mean of "ab", "ac", ..., all the way to "abcde". Is there a simple way of doing this?</p>
  
  <p>All I've tried is manually creating the code for each variable. However, it seems like something like a loop would be more appropriate. </p>
  
  <p>For example, if my data looked like this:</p>
  
  <pre><code>a &lt;- rnorm(10, 0, 1)
  b &lt;- rnorm(10, 0, 1)
  c &lt;- rnorm(10, 0, 1)
  d &lt;- rnorm(10, 0, 1)
  e &lt;- rnorm(10, 0, 1)
  data &lt;- cbind.data.frame(a,b,c,d,e)
  </code></pre>
  
  <p>I want the data to look like the output as if I had done this for each combination of a, b, c, d, e:</p>
  
  <pre><code>data$ab &lt;- (data$a + data$b)/2
  .
  .
  .
  data$abcde &lt;- (data$a + data$b + data$c + data$d + data$e)/5
  </code></pre>