[R] subset in a BIG matrix

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed Feb 2 18:39:06 CET 2011


Hi,

On Wed, Feb 2, 2011 at 8:30 AM, alcesgabbo <alcesgabbo at hotmail.com> wrote:
>
> I have a matrix with a lot of values inside..
>
> when I execute the folowing command
>
> matrix2=subset(martix, condition.....)
>
> it works...
>
> but after the previous command I execute another "subset"
>
> matrix3=subset(martix2, condition2.....)
>
> and appears the following error:
>
> (subscript) logical subscript too long
>
> How can I solve this???
> I think the probles is the size of the matrix...

Without your actual code, it's hard to tell, but if I were to take a
guess, I think you're generating your `condition2` logic vector based
on your original `matrix` maybe?

If you aren't already doing so, put your subsetting "logic" into your
`subset` call, eg:

matrix3 <- subset(matrix2, some.column <= some.value) ## or whatever

-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list