[BioC] matrix row/column displayed as a list

Sean Davis sdavis2 at mail.nih.gov
Tue Apr 3 12:48:25 CEST 2007


On Tuesday 03 April 2007 06:04, Daniel Brewer wrote:
> Sean Davis wrote:
> > On Monday 02 April 2007 12:43, Daniel Brewer wrote:
> >> Sorry it has taken so long for me to reply, I have been away.  I enclose
> >> a cut down version of my expression matrix.  Here is an example of my
> >>
> >> session:
> >>> matrixExample2
> >>
> >>               GSM89679 GSM89681 GSM89683 GSM89684 GSM89685
> >> IMAGE:1031489 -0.828   -0.618   -1.154   -0.975   -0.59
> >> IMAGE:1031497 -0.426   -0.515   -0.765   -0.443   -0.713
> >> IMAGE:1031509 -0.301   -0.923   1.437    -0.836   0.461
> >> IMAGE:1031510 -0.976   -0.814   0.268    -1.331   0.913
> >> IMAGE:1031516 -2.066   0.134    0.332    -2.018   1.489
> >> IMAGE:1031532 -0.754   -2.202   -1.438   -2.054   -0.836
> >
> > Hi, Dan.
> >
> > What does:
> >
> > class(matrixExample2) show?
> >
> > What happens if you do:
> >
> > matrixExample3 <- as.matrix(matrixExample2)
> > class(matrixExample3)
> > matrixExample3[,1]
> > class(matrixExample3[,1])
> >
> > Finally, what is the output of sessionInfo()?
> >
> > Sean
>
> Hi Sean,
>
> Here are the results of the commands you suggested.
>
> > load("matrixExample.rdata")
> > class(matrixExample2)
>
> [1] "matrix"
>
> > matrixExample3 <- as.matrix(matrixExample2)
> > class(matrixExample3)
>
> [1] "matrix"
>
> > matrixExample3[,1]
>
> $`IMAGE:1031489`
> [1] -0.828
>
> $`IMAGE:1031497`
> [1] -0.426
>
> $`IMAGE:1031509`
> [1] -0.301
>
> $`IMAGE:1031510`
> [1] -0.976
>
> $`IMAGE:1031516`
> [1] -2.066
>
> $`IMAGE:1031532`
> [1] -0.754
>
> > class(matrixExample3[,1])
>
> [1] "list"
>
> > sessionInfo()
>
> R version 2.4.1 (2006-12-18)
> x86_64-unknown-linux-gnu
>
> locale:
> LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-
>8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NA
>ME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATIO
>N=C
>
> attached base packages:
> [1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
> [7] "base"
>
> So that does not provide much insight. Have you got any other suggestions?

Well, you've got me stumped, but that isn't too hard to do.  

Sean



More information about the Bioconductor mailing list