Hi, everybody! I am currently dealing with spatial estimation and thus writing some smoothing algorithms. My question concerns the graphical output. I would like my function to produce a picture of input data (X) and of estimation results(Y). Both, X and Y are categorical variables which can take values 1,2,...,Cl. So, basically I write foo<-function(){ .... image(X,...,col=terrain.colors(Cl)) image(Y,...,col=terrain.colors(Cl)) } However, as a result of smoothing, some classes may disappear completely. For example: X Y 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 In output then graph for X would have green for 0 and yellow for 1, whereas the graph for Y would be all green. Thus the two pictures cannot be compared. Is there any way around this problem? Thank you in advance for any help. Best regards, Elena MOLTCHANOVA IIASA International Institute for Applied Systems Analysis A-2361 Laxenburg, Austria E-Mail: moltchan at iiasa.ac.at Phone : +43 2236 807-0 Fax : +43 2236 71313 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 7 Aug 2001, Elena MOLTCHANOVA wrote:> Hi, everybody! > > I am currently dealing with spatial estimation and thus writing some > smoothing algorithms. My question concerns the graphical output. I would > like my function to produce a picture of input data (X) and of estimation > results(Y). Both, X and Y are categorical variables which can take values > 1,2,...,Cl. So, basically I write(You have X = 0 in the example.)> foo<-function(){ > .... > > image(X,...,col=terrain.colors(Cl)) > image(Y,...,col=terrain.colors(Cl)) > } > > However, as a result of smoothing, some classes may disappear completely. > For example: > > X Y > 1 1 1 1 1 1 > 1 0 1 1 1 1 > 1 1 1 1 1 1 > > In output then graph for X would have green for 0 and yellow for 1, whereas > the graph for Y would be all green. Thus the two pictures cannot be > compared. Is there any way around this problem?Set zlim = c(0.5, Cl+0.5) for values 1,2,...,Cl.> > Thank you in advance for any help. > > Best regards, > > Elena MOLTCHANOVA > IIASA > International Institute for Applied Systems Analysis > A-2361 Laxenburg, Austria > E-Mail: moltchan at iiasa.ac.at > Phone : +43 2236 807-0 > Fax : +43 2236 71313 > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
You might want to use the `breaks=' argument. You would have to decide on the breakpoints and the associated colors beforehand, but that seems OK if you know Cl: breaks <- 0:Cl + 0.5 # assuming classes 1,2,...,Cl col <- terrain.colors(Cl) image(X,...,col=col, breaks=breaks) image(Y,...,col=col, breaks=breaks) --- Elena MOLTCHANOVA <moltchan at iiasa.ac.at> wrote:> Hi, everybody! > > I am currently dealing with spatial estimation and > thus writing some > smoothing algorithms. My question concerns the > graphical output. I would > like my function to produce a picture of input data > (X) and of estimation > results(Y). Both, X and Y are categorical variables > which can take values > 1,2,...,Cl. So, basically I write > > foo<-function(){ > .... > > image(X,...,col=terrain.colors(Cl)) > image(Y,...,col=terrain.colors(Cl)) > } > > However, as a result of smoothing, some classes may > disappear completely. > For example: > > X Y > 1 1 1 1 1 1 > 1 0 1 1 1 1 > 1 1 1 1 1 1 > > In output then graph for X would have green for 0 > and yellow for 1, whereas > the graph for Y would be all green. Thus the two > pictures cannot be > compared. Is there any way around this problem?__________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._