<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt'>
<p>Dear all,</p>
<p><br /></p>
<p>Not so much a question as a bit of adapted code.</p>
<p><br /></p>
<p>Recently, I've been working with the spatstat package and using maptools to convert raster objects to spatstat's im format. One issue I have been having is the conversion of factor raster layers to im. To that end, I've adapted the maptools::as.im.RasterLayer() function to work with factor layers.</p>
<p><br /></p>
<p>I realise that quite possibly this is a problem that has an alternative solution that I'm unaware of, but in case my adapted function is useful to others or something which you would like to include in the next release of maptools, I have attached it here.</p>
<p><br /></p>
<p>Thanks for your work with maptools, and with all best wishes,</p>
<p>Matt</p>
<p><br /></p>
<p>This email was originally sent to Roger Bivand who directed me to this list.</p>
<div id="signature">-- <br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Matt Lewis (he/him)<br />MPhil Student<br /><br />Insect Ecology Group<br />Department of Zoology<br />University of Cambridge<br />CB2 3EJ<br /><br /><a href="mailto:ml807@cam.ac.uk">ml807@cam.ac.uk</a> | <a href="mailto:matthewlewis896@gmail.com">matthewlewis896@gmail.com</a><br />@matthewlewis896<br /><a href="https://www.zoo.cam.ac.uk/directory/matthew-lewis" target="_blank" rel="noopener noreferrer">https://www.zoo.cam.ac.uk/directory/matthew-lewis</a></div>
</div>
</body></html>