Skip to content
Prev 28179 / 29559 Next

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.