title: Calculating a mean, but leaving numbers of unique variables
body: <p>I'm struggling a bit with R and plyr, I don't know how to obtain the result I'm interested in. I have a dataframe looking like this:</p>
  
  <pre><code>Region Price
  Alentejano 71
  Andalucia 30
  Bordeaux 135
  Bordeaux 500
  Bordeaux 185
  </code></pre>
  
  <p>And so on. I would like to get the mean for each Region, and so far I tried with <code>plyr</code> and the code:</p>
  
  <pre><code>means &lt;- ddply(data, ~ Region, summarise, mean = mean(Price), sd=sd(Price))
  </code></pre>
  
  <p>which succesfully gives me the standard deviation in places where I have more than one observance per variable. I do not get any means. How do I make a code that gives me a mean for multiple observances, but leaves the number if there is only one observance?</p>