[R-sig-Geo] newbie bbox type question

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon May 30 16:05:58 CEST 2011


 > plot(as(m, "Spatial"))

 Coercion with 'as' seems to fail for me:

 > rb=bbox(r)
 > rb
        min       max
x -2.840466 -2.342137
y 54.042700 54.339724
 > as(rb,"Spatial")

Error in as(rb, "Spatial") :
  no method or default for coercing "matrix" to "Spatial"

but using Spatial() works:

 plot(Spatial(rb))

despite the warning about Spatial being an abstract class...


> which drops all the unnecessary stuff. I wasn't sure what was needed,
> either. It could be an output file with the data reshaped to "wide" from
> "long", but this is just another guess.

 Texas may be awake now, but I think it might be a holiday in the USA...

Barry



More information about the R-sig-Geo mailing list