[R] Problems getting symbols() to show table data

Guy Green guygreen at netvigator.com
Thu Apr 15 15:23:45 CEST 2010


Thanks, balloonplot() is great and gets me really close to what I am after.

However it then brings me to a slightly different problem - I wonder if
anyone can suggest where I am going wrong?

Again with simplified data (
http://n4.nabble.com/file/n1890724/test-data.txt test-data.txt ):

           Aug-03   Nov-03   Feb-04   May-04   Aug-04
Row1       1         -1.1         1.2        1.3        -1.4
Row2       3         -3.1         3.2        3.3        -3.4
Row3       5         -5.1         5.2       -5.3         5.4

library(gplots)
Read_data=read.table("C:/files/test-data.txt", head = T)
number_rows = nrow(Read_data)
number_cols = ncol(Read_data)
matrix_data = as.matrix(Read_data)
row_names = rep(rownames(matrix_data),number_cols)
col_names = rep(colnames(matrix_data),number_rows)
x11(width=120, height=80)
balloonplot(col_names, row_names, abs(matrix_data),
	dotcolor = c("lightblue", "red")[(c(matrix_data) < 0) + 1],
	show.margins = FALSE, cum.margins = FALSE, 
	xlab = "", ylab = "", label=T, label.lines= F, colsrt=90, sorted = F,
	rowmar=3, colmar=2.5,) 

This gives this graphic:  http://n4.nabble.com/file/n1890724/R_upload.jpeg
R_upload.jpeg .

The data colours go in the "right" places within the grid - i.e. with the
correct numbers.  However the numbers themselves are mixed up within each
row.  Transposing the matrix_data within balloonplot() doesn't correct it.

Can someone see something simple that I am missing here?  Thanks,

Guy
-- 
View this message in context: http://n4.nabble.com/Problems-getting-symbols-to-show-table-data-tp1839676p1890724.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list