[R] figure-definition and heatmap question
Antje
niederlein-rstat at yahoo.de
Thu Aug 23 14:47:20 CEST 2007
Hello,
I have two questions. I'd like to visualize data with a heatmap and I have the
following testcase:
x <- rnorm(256)
nx <- x + abs(min(x))
nnx <- 255/max(nx) * nx
x <- matrix(nnx, 16, 16)
rownames(x) <- c("A","B","C","D","E","F","G","I","H","J","K","L","M","N","O","P")
par(fin=c(8.0,8.0))
cp <- colorRampPalette(c("white","springgreen","darkgreen"),space="Lab")
heatmap(x, Rowv = NA, Colv = NA, scale="none", col=cp(200))
I defined the figure region to make sure that each position is a square. But
with these settings I get the following output (though it looks nice):
> x <- rnorm(256)
> nx <- x + abs(min(x))
> nnx <- 255/max(nx) * nx
> x <- matrix(nnx, 16, 16)
> rownames(x) <-
c("A","B","C","D","E","F","G","I","H","J","K","L","M","N","O","P")
> par(fin=c(8.0,8.0))
> cp <- colorRampPalette(c("white","springgreen","darkgreen"),space="Lab")
> heatmap(x, Rowv = NA, Colv = NA, scale="none", col=cp(200))
Fehler in par(op) : ungültiger Wert für den Grafikparameter "fig" spezifiziert
> par(fin=c(8.0,8.0))
> cp <- colorRampPalette(c("white","springgreen","darkgreen"),space="Lab")
> heatmap(x, Rowv = NA, Colv = NA, scale="none", col=cp(200))
Fehler in par(op) : ungültiger Wert für den Grafikparameter "fig" spezifiziert
> par()$fig
[1] 7.267443e-04 1.305448e-02 -2.862294e-17 9.876543e-01
> par()$fin
[1] 0.08834875 7.06790021
Why do I get this error? Why does the parameters have these strange values
(though I set the fin parameter before...)
And another question concerning the heatmap: May I force the funtion to plot A1
at the upper left corner instead of the lower left?
I'll be glad about any idea how to solve these problems...
Ciao,
Antje
More information about the R-help
mailing list