On 28.01.2012 05:43, Melissa Patrician wrote:
Hi,
Please excuse my inexperience, 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
Try this:
mine - 1:6
table.combos - matrix(data = 1:12, nrow = 10, ncol = 6, byrow)
row.is.a.match - apply(table.combos, 1, identical, mine)
match.idx - which(row.is.a.match)
total.matches - sum(row.is.a.match)
On Sat, Jan 28, 2012 at 2:10 AM, Jason J. Pitt pit...@uchicago.edu wrote:
Hi
Hi,
Please excuse my inexperience, 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
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
Hi Melissa,
Well, assuming you know the length of the length of the row in
the matrix and vector are the same... if you need a quick fix
you could use
mine - 1:6
table.combos - matrix(data = 1:12, nrow = 2, ncol = 6, byrow
= T)
sum(mine == table.combos[1, ]) == length(mine)
# returns TRUE
5 matches
Mail list logo