title: How to know the percentage of occurence of a value in a raster in R?
body: <p>If have a raster <code>r</code>:</p>
  
  <pre><code> r &lt;- raster(nrows=10, ncols=10)
  values(r) &lt;- runif(ncell(r))
  </code></pre>
  
  <p>Now I would like to know how much (in percent) the value <code>0.5</code> occurs in this raster in comparison to the others(in other words how many pixels that contain this value among all pixels of this raster)</p>
  
  <p>thanks</p>