title: R Crop no-data of a raster
body: <p>I would like to crop the no-data part of some rasters (example of the image in  <a href="https://i.stack.imgur.com/hkr4d.png" rel="noreferrer">1</a> where no-data is in black) without defining the extent manually.</p>
  
  <p>Any idea?</p>
  
  <p><img src="https://i.stack.imgur.com/hkr4d.png" alt="image with no-data"></p>