]
Gesendet: Samstag, 13. Juli 2013 19:57
An: William Dunlap
Cc: mailman, r-help; Thiem Alrik
Betreff: Re: [R] Test for column equality across matrices
I tried it on a slightly bigger dataset:
A1 - matrix(t(expand.grid(1:90, 15, 16)), nrow = 3)
B1 - combn(90, 3)
which(is.element(columnsOf(B1
Dunlap
Cc: R help; Thiem Alrik
Subject: Re: [R] Test for column equality across matrices
I tried it on a slightly bigger dataset:
A1 - matrix(t(expand.grid(1:90, 15, 16)), nrow = 3)
B1 - combn(90, 3)
which(is.element(columnsOf(B1), columnsOf(A1)))
# [1] 1067 4895 8636 12291 15861 19347
Dear list,
I have two matrices
A - matrix(t(expand.grid(c(1,2,3,4,5), 15, 16)), nrow = 3)
B - combn(16, 3)
Now I would like to exclude all columns from the 560 columns in B which are
identical to any 1 of the 6 columns in A. How could I do this?
Many thanks and best wishes,
Alrik
Sent: Saturday, July 13, 2013 6:45 AM
To: mailman, r-help
Subject: [R] Test for column equality across matrices
Dear list,
I have two matrices
A - matrix(t(expand.grid(c(1,2,3,4,5), 15, 16)), nrow = 3)
B - combn(16, 3)
Now I would like to exclude all columns from the 560 columns in B
.
- Original Message -
From: William Dunlap wdun...@tibco.com
To: Thiem Alrik th...@sipo.gess.ethz.ch; mailman, r-help
r-help@r-project.org
Cc:
Sent: Saturday, July 13, 2013 1:30 PM
Subject: Re: [R] Test for column equality across matrices
Try
columnsOf - function(mat) split(mat, col(mat))
newB
(match(interaction(as.data.frame(t(B))),interaction(as.data.frame(t(A)]
identical(B1,B2)
#[1] TRUE
A.K.
- Original Message -
From: Thiem Alrik th...@sipo.gess.ethz.ch
To: mailman, r-help r-help@r-project.org
Cc:
Sent: Saturday, July 13, 2013 9:45 AM
Subject: [R] Test for column
6 matches
Mail list logo