Re: [R] value replacement in matrices

2003-08-04 Thread Uwe Ligges
George, Charles R wrote: Hello R users I would like to ask if anyone knows a computationally fast solution to this problem: I have an original matrix and an index matrix. The original matrix is ca 4000x4000 cells, and the index matrix has 261 unique values. From these, I want to produce a new

Re: [R] value replacement in matrices

2003-08-04 Thread kjetil brinchmann halvorsen
On 4 Aug 2003 at 10:10, Uwe Ligges wrote: George, Charles R wrote: snip replace(originalMat, indexMat[,1], indexMat[,2]) Shouldnt that be originalmat - replace(originalMat, indexMat[,1], indexMat[,2]) ? Kjetil Halvorsen Uwe Ligges the output would look like this:

[R] value replacement in matrices

2003-08-03 Thread George, Charles R
Hello R users I would like to ask if anyone knows a computationally fast solution to this problem: I have an original matrix and an index matrix. The original matrix is ca 4000x4000 cells, and the index matrix has 261 unique values. From these, I want to produce a new matrix. Consider the