[BioC] matrix row/column displayed as a list
Seth Falcon
sfalcon at fhcrc.org
Fri Mar 30 16:13:09 CEST 2007
Daniel Brewer <daniel.brewer at icr.ac.uk> writes:
> Hi,
>
> This is a silly little question, but I can't find the answer. I have a
> matrix of expression values e.g. expression. When I display either one
> column or one row it displays a list e.g. expression[1,] or
> expression[,1]. Is there a way to change this behaviour?
I think you mean that it displays a vector. I think you will find
help by reading help("[") and looking at the 'drop' argument.
togo <- matrix(c(1,2,3,4),ncol=2, nrow=2)
> togo[1, ]
[1] 1 3
> togo[1, , drop=FALSE]
[,1] [,2]
[1,] 1 3
+ seth
--
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
http://bioconductor.org
More information about the Bioconductor
mailing list