title: calculating mean of subset between two dates
body: <p>I am to calculate the mean of values (market closing prices, denoted as "Close") between two dates, based on following data set: </p>
  
  <p><a href="http://r-exercises.com/wp-content/uploads/2016/07/data.csv" rel="nofollow">http://r-exercises.com/wp-content/uploads/2016/07/data.csv</a></p>
  
  <p>The answer to this task is structured as follows:</p>
  
  <pre><code>mean(subset(d, as.Date(d$Date) &gt;= as.Date(start) &amp; as.Date(d$Date) &lt;= as.Date(end))$Close)
  </code></pre>
  
  <p>However, I don't understand this part:</p>
  
  <pre><code>mean(...)$Close
  </code></pre>
  
  <p>Does that mean, that mean is calculated only on "Close" category of the data frame? I have looked in the documentation of the "mean" function but I haven't encountered such syntax.</p>
  
  <p>I would be very grateful for an explanation</p>