k)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-error">
<pre><code>Error in UseMethod("as.raster"): no applicable method for 'as.raster' applied to an object of class "c('LayerInstance', 'Layer', 'ggproto', 'gg')"</code></pre>
</div>
</div>
<p>The error message here complains that R doesn’t know how to convert the <code>mask</code> layer to a raster object. Remember at the beginning I said that ggfx work