[R-sig-Geo] problem using levelplot() + layer() in a function

Oscar Perpiñan oscar.perpinan at upm.es
Fri Mar 21 19:23:13 CET 2014


> The idea of Pascal I had tried already and it doesn't work. At the end, I
> had found out a way out using this:
>
>     print(levelplot(wstr$r,col.regions=wstr$clrs,margin=FALSE,main=paste('t
> = ',FootPrint), colorkey = T, scales=list(draw=FALSE),
>               panel=function(...){
>                 panel.levelplot(...)
>                 panel.polygon(wstr$spbox,lwd=2)
>                 panel.polygon(lncoords,lwd=2, border='red')}))
> Oscar: I suppose this is your third function you had proposed...

Yes, exactly.

> the others still do not seem to work... I must admit it is not too clear to me why,
> but at least the last one works...

Could you please post the code you are using? All of them should work.

Best,

Oscar.



More information about the R-sig-Geo mailing list