Dear fellow Stackoverflow users,
I am a beginner in using R language for the purpose of analysing biological data and am facing a problem that I haven't been able to solve yet - maybe someone more experienced can help me out on this?
I have a large data frame which is a binary matrix. each row represents a different gene; each column a different condition in an experiment.
"1" in a cell indicates that gene is present in the given condition, "0" indicates the gene is not present.
How do I get a vector with rownames of the rows that contain a "1" only in a given column, but no other column (i.e., genes that are uniquely present in that condition?)
And how can I get a vector with rownames of the rows that contain "1" in a specified set of columns but "0" in all other columns (i.e., genes that are uniquely present in conditions /colums 1,2 and 5 for example?
I am looking forward to your suggestions!
Many thanks:-)