Thanks, guys. I'll take at a look at these solutions. BTW, my apologies, by
A,B,C,D,... I meant just some real number, not characters A,B,..., but
I wasn't clear about that. If that effects the solution approach please let
me know, but I don't think it does. Thanks again, Doug
Marc Schwartz-3
Sorry, there may be some lingo for describing the extraction problem I have,
but I don't know it.
I have a matrix of 2 rows and N columns, and a vector of N 1s and 2s.
Matrix M:
1 2 3 4 ... N
1A C D G ...
2B D F H ...
Vector v:
On Jun 10, 2009, at 12:36 PM, Logickle wrote:
Sorry, there may be some lingo for describing the extraction problem
I have,
but I don't know it.
I have a matrix of 2 rows and N columns, and a vector of N 1s and 2s.
Matrix M:
1 2 3 4 ... N
1A C D G
On Jun 10, 2009, at 6:26 PM, Marc Schwartz wrote:
On Jun 10, 2009, at 12:36 PM, Logickle wrote:
Sorry, there may be some lingo for describing the extraction
problem I have,
but I don't know it.
I have a matrix of 2 rows and N columns, and a vector of N 1s and 2s.
Matrix M:
1
Subscripting by a 2-column matrix
M[cbind(v, seq_len(ncol(M)))]
uses much less space (hence time) than making
the ncol(M) by ncol(M) intermediate matrix just
to extract its diagonal. E.g.
test - function(n, seed) {
if (!missing(seed))
set.seed(seed)
M - matrix(sample(LETTERS,
On Jun 10, 2009, at 7:05 PM, William Dunlap wrote:
Subscripting by a 2-column matrix
M[cbind(v, seq_len(ncol(M)))]
uses much less space (hence time) than making
the ncol(M) by ncol(M) intermediate matrix just
to extract its diagonal. E.g.
test - function(n, seed) {
if (!missing(seed))
On Jun 10, 2009, at 1:36 PM, Logickle wrote:
Sorry, there may be some lingo for describing the extraction problem
I have,
but I don't know it.
I have a matrix of 2 rows and N columns, and a vector of N 1s and 2s.
Matrix M:
1 2 3 4 ... N
1A C D G
7 matches
Mail list logo