title: How do I calculate the mean for the data set in R Studio?
body: <p>Below is my data set.</p>
  <p><img src="https://i.stack.imgur.com/i3cJn.jpg" alt="Data set" /></p>
  <p>To find mean for entire column (Column Name: BP) I have achieved it using the below R code</p>
  <pre><code>library(Sleuth3)
  ex0112
  View(ex0112)
  mean(ex0112$BP)
  </code></pre>
  <p>But how do I calculate the mean (of BP) for only the Regular Oil Diet?
  I am new to R programming. Your help is highly appreciated</p>