[BioC] matrix row/column displayed as a list

Daniel Brewer daniel.brewer at icr.ac.uk
Mon Apr 2 18:43:13 CEST 2007


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
> matrixExample2[,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


[1] -0.754

> class(matrixExample2[,1])
[1] "list"
> matrixExample2[1,]
$GSM89679
[1] -0.828

$GSM89681
[1] -0.618

$GSM89683
[1] -1.154

$GSM89684
[1] -0.975

$GSM89685
[1] -0.59

> class(matrixExample2[1,])
[1] "list"
> save(matrixExample2,file="matrixExample.rdata")

As you can see the single rows and columns are lists whereas when I
constructed a matrix (see previous email + below) the rows and column
were of class numeric.  I have had no success in converting the matrix
away from being a list.

Any help with this would be gratefully received.  It is clear I am
missing something.

Dan

PS Example from before
> togo <- matrix(c(1,2,3,4),ncol=2, nrow=2)
> togo
     [,1] [,2]
[1,]    1    3
[2,]    2    4
> togo[,1]
[1] 1 2
> class(togo[,1])
[1] "numeric"

Seth Falcon wrote:
> Daniel Brewer <daniel.brewer at icr.ac.uk> writes:
> 
>> Yes I have already tried that, class(expression) is matrix.  But
>> class(expression[1,]) is list as is class(expression[,1]).  Whereas the
>> class of my simple constructed matrix when looking at a single row or
>> column is numeric i.e. class(togo[,2]).
>>
>> Thanks for the suggestion anyway.
> 
> Then you need to provide a lot more detailed information /
> reproducible example.
> 
> + seth
> 

-- 
**************************************************************

Daniel Brewer, Ph.D.

Institute of Cancer Research
Molecular Carcinogenesis
MUCRC
15 Cotswold Road
Sutton, Surrey SM2 5NG
United Kingdom

Tel: +44 (0) 20 8722 4109
Fax: +44 (0) 20 8722 4141

Email: daniel.brewer at icr.ac.uk

**************************************************************


The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addre...{{dropped}}



More information about the Bioconductor mailing list