[BioC] imageplot problem from limma

Gordon K Smyth smyth at wehi.EDU.AU
Fri Feb 6 03:29:09 MET 2004


> Hi,
>
> I'm trying to plot a vector of log ratios using the imageplot functions
> but it keeps telling me my dimensions are incorrect.
>
> Here's what I did.
>
> x <- dir(pattern="test.txt")
> # where test.txt contains a 16200 by 12 matrix of numbers (with NAs) x
> <- read.delim(x, header=TRUE)
> y <- c(x[1])
> imageplot(y,layout=list(ngrid.r=5,ngrid.c=12,nspot.r=30,nspot.c=9))
>
>
> And this is the error message:
> Error in imageplot(y, layout = list(ngrid.r = 5, ngrid.c = 12, nspot.r =
> 30, :
>         Number of image spots does not agree with layout dimensions
>
>
> I check the dimension of y and it's indeed 16200.
>> dim(data.frame(y))
> [1] 16200     1
>
> What am I doing wrong?

If you look at the help page for 'imageplot', you'll see that the first
argument is expected to be a "numeric vector or array".  You're giving it
a list, as you could check for yourself by typing 'class(y)'.  Your object
'y' doesn't have any dimensions and has length 1, which you'd see if you
typed 'dim(y)'.

All would work fine if you extracted 'y' from 'x' using 'y <- x[,1]' or
converted 'y' to numeric using 'y <- as.numeric(y)'.

Gordon

> Thanks!!
>
> Anna



More information about the Bioconductor mailing list