[R] checkerboard plot?

Bill.Venables@cmis.csiro.au Bill.Venables at cmis.csiro.au
Sat May 18 07:22:43 CEST 2002


Not sure what a chequerboard plot is, but here is perhaps a start for what
you want:

> image(t(junk), axes = F)
> pu <- par("usr")
> abline(v = seq(pu[1], pu[2], len=6), h = seq(pu[3], pu[4], len=6))

It would be easy to make this into a general function (as you will find, no
doubt)!

Bill Venables


-----Original Message-----
From: Andy Bunn [mailto:abunn at montana.edu]
Sent: Saturday, May 18, 2002 2:24 PM
To: r-help at stat.math.ethz.ch
Subject: [R] checkerboard plot?


Hi,

I've been doing a lot of CA modeling lately and am now wanting to make some
checkerboard plots in R.

Let's say I have a matrix:

> is.matrix(junk)
[1] TRUE
> junk
     [,1] [,2] [,3] [,4] [,5]
[1,]    0    0    1    0    0
[2,]    0    1    1    1    0
[3,]    0    1    0    0    1
[4,]    0    1    1    1    1
[5,]    0    1    0    0    0
>

and I want to make a checkerboard with 0 being white and 1 being black.

Any thoughts on how I wuld do this?

Thanks in advance,
Andy

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



More information about the R-help mailing list