title: R density map over a specific multipolygon
body: <p>I want to create a heatmap with the code below.</p>
  <pre><code>data_smoothed = ggplot() +
    metR::geom_contour_fill(data = data.dolphins, aes(x = lon, y = lat, z = density), 
                            bins = 120, na.fill = TRUE)+
    coord_sf(xlim = c(-1, 5), ylim = c(37,43))+ #I want to change this 
    scale_fill_viridis_c() +
    metR::scale_x_longitude(ticks = 2)+
    metR::scale_y_latitude(ticks=2)+
    theme_bw() +
    ggtitle(&quot;dolphins&quot;)+
    theme(plot.title = element_text(hjust = 0.5)) 
  </code></pre>
  <p>which returns this:
  <a href="https://i.stack.imgur.com/KCcgK.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>However, instead of receiving this, I would only like to keep these parts of the heatmap that fall within a multipolygon I already have.</p>
  <pre><code>&gt; poly
  Simple feature collection with 1 feature and 0 fields
  Geometry type: MULTIPOLYGON
  Dimension:     XY
  Bounding box:  xmin: -1 ymin: 37 xmax: 6 ymax: 42.42764
  Geodetic CRS:  WGS 84
                          geometry
  1 MULTIPOLYGON (((0.5 39.5, 0...
  </code></pre>
  <p>i.e something like the parts of the heatmap that fall within the poygon shown below.
  <a href="https://i.stack.imgur.com/ZUVCB.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>Any ideas?</p>