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... Thanks.. -- View this message in context: http://r.789695.n4.nabble.com/subset-in-a-BIG-matrix-tp3254115p3254115.html Sent from the R help mailing list archive at Nabble.com.
To solve it, a little more data would help. At least provide exactly the statements you are using and an 'str' of the objects; e.g., str(matrix2) str(condition2) error message might indicate that the length of condition2 is larger than the subset of matrix2 that you want. 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... > Thanks.. > -- > View this message in context: http://r.789695.n4.nabble.com/subset-in-a-BIG-matrix-tp3254115p3254115.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Jim Holtman Data Munger Guru What is the problem that you are trying to solve?
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