[R] Plot table of counts

Jim Lemon jim at bitwrit.com.au
Sun Oct 19 12:03:13 CEST 2008


pofigster at gmail.com wrote:
> I have a data set which is comprised of counts, that is, the number of times a mass spectrometer measured a particular mass at a particular time (the rows and columns of the table).  Is there a way to make a plot so that it draws a square at the mass/time spot on the graphic if there is a count and leave it empty if it's empty?
>
>   
Hi pofigster,
You can do this with color2D.matplot in the latest version of plotrix 
(2.4-8) that has just been uploaded (may take a day or two to appear):

color2D.matplot(mydata,1,0,1)

will produce a plot with purple rectangles at each number and white 
(default, you can change it) rectangles where there are NAs.

Jim



More information about the R-help mailing list