[R-sig-Geo] Package sp: image() and breaks= for SpatialGridDataframe

Ghislain Vieilledent ghislain.vieilledent at cirad.fr
Thu Feb 3 10:10:10 CET 2011


Dear list,

I encountered a problem using function image() and argument breaks on a
SpatialGridDataFrame object (package sp version 0.9-76, R version 2.12.1
(2010-12-16) on Ubuntu 10.04).

I had to use function as.image.SpatialGridDataFrame before to obtain the
correct colored graphic:

# Doesn't work:
image(SDAzD.As.A2a.2080,breaks=c(seq(0,0.5,0.1),1),col=c(grey(seq(0.9,0.5,-0.1)),"dark green"))

# Works:
xyz <- as.image.SpatialGridDataFrame(SDAzD.As.A2a.2080)
image(xyz,breaks=c(seq(0,0.5,0.1),1),col=c(grey(seq(0.9,0.5,-0.1)),"dark
green"))

Is this a normal behavior ?

Best regards,

Ghislain

-- 
_________________________________________________

Ghislain VIEILLEDENT
CIRAD - UR 105 Forest Ecosystem Goods & Services
Ampandrianomby BP 853
Antananarivo - MADAGASCAR
Phone: +261.(0)32.07.235.34
Skype: ghislain.vieilledent
E-mail : ghislain.vieilledent at cirad.fr

Research unit web site: http://www.cirad.fr/ur/bsef
Personal web site: http://ghislain.vieilledent.free.fr



More information about the R-sig-Geo mailing list