maptools::as.im.RasterLayer with factor layers
Dear all, Not so much a question as a bit of adapted code. 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. 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. Thanks for your work with maptools, and with all best wishes, Matt This email was originally sent to Roger Bivand who directed me to this list.
Matt Lewis (he/him) MPhil Student Insect Ecology Group Department of Zoology University of Cambridge CB2 3EJ ml807 at cam.ac.uk | matthewlewis896 at gmail.com @matthewlewis896 https://www.zoo.cam.ac.uk/directory/matthew-lewis -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20200609/b8707026/attachment.html> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: as.im.RasterLayer.R URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20200609/b8707026/attachment.ksh>