[R] Searching for specific values in a matrix

Steve Lianoglou mailinglist.honeypot at gmail.com
Mon Jul 27 23:56:34 CEST 2009


> no luck, it's okay, i will figure it out!  i might isolate and  
> recombine all the columns, maybe that will work.  thanks for the help!

No, wait .. no luck in being able to select out rows from your  
data.frame using values you see somewhere in the top 10 rows?

Can you just paste in some key lines in your session so we can see?

For instance, let's assume your data is in my.data, I'd like to see  
the results for:

# Replace the column values (1:5) with other columns
# you want to use for selection
R> my.data[1:10,1:5]

# Now show me your query and it's result that returns
# a <0-row> data.frame, for example using a value
# that appears in that column from the previous query
R> my.data[my.data[,1] == 'something',]
<0 rows> (or 0-length row.names)

There should be a simple answer to what's going wrong here.

-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