title: Analyse Pixel distribution of a Rasterlayer
body: <p>I really really need some advice. I have a Raster with many pixels. Each pixel has one value. Now I want to do a spatial analysis of these pixels. I want to see in which region have the most pixels and were not. Sounds simple, but it's not.</p>
  <p>I had an idea to do this with the kernal density but it does not work with rasterlayer. It doesn't work either with ppp, because you can't transform a raster into this data type. I'm really lost. I don't know what could work. So I would be very grateful if I could get some help.</p>
  <p>My Pixels looks like this:<br />
  <a href="https://i.stack.imgur.com/ZQe43.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZQe43.png" alt="Pixels" /></a></p>
  <p>There must be a way to show the regions with the most pixels and so on. But I don't know how I can do that.</p>