[R-sig-Geo] maptools::as.im.RasterLayer with factor layers

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Wed Jun 24 17:44:53 CEST 2020


Not seeing a reply here, I opened an issue: 
https://github.com/spatstat/spatstat/issues/132, which has been answered. 
If you are on github, Matt and others interested, please look at the code 
and let me know when it stabilises enough to revise maptools.

Roger

On Tue, 9 Jun 2020, Matt Lewis wrote:

> 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.
>
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en



More information about the R-sig-Geo mailing list