[R] finding rows in a matrix that match a vector
Melrose2012
melissa.patrician at stonybrook.edu
Sat Jan 28 02:39:05 CET 2012
Hi,
Please excuse my ignorance, but I am just learning R (this is my very first
day programming in R) and having a really hard time figuring out how to do
the following:
I have a matrix that is 1000 row by 6 columns (named 'table.combos') and a 1
row by 6 column vector (named 'mine'). I want to find every row in
'table.combos' that equals 'mine' and then count this number of times that
this is the case.
In matlab, I would use the 'find' command but I can not seem to figure out
what syntax to use for R.
Can anyone please help?
Again, I'm assuming this is probably a very easy thing to do, but since I am
new to R, I am having a hard time figuring it out. I did some research on
previous posts and saw that the 'apply' function appears to do osmething
like this, except I don't know what function I am supposed to input into
'apply' to use this.
Thanks in advance for the help!
Cheers,
Melissa
--
View this message in context: http://r.789695.n4.nabble.com/finding-rows-in-a-matrix-that-match-a-vector-tp4335216p4335216.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list