[R] when deleting a row from a matrix gives a vector

Vijay Vaidyanathan vijay at MyEmailForever.com
Fri Nov 2 20:54:14 CET 2007


On Nov 2, 2007, at 12:50 PM, Sarah Goslee wrote:
> x <- x[1, drop=FALSE]
>
>> Is there any way to force the result to remain a matrix, even if it
>> has only one row or column, or even only one entry? Thanks,

I think you might have meant ...

x <- x[1,,drop=FALSE]

Note the double commas ...

- VV
====

> -- 
> Sarah Goslee
> http://www.functionaldiversity.org



More information about the R-help mailing list