Brilliant Denes. Thank you for your help. This worked and is obviously much
faster than a loop...
On Thu, Sep 17, 2015 at 3:22 PM, Dénes Tóth wrote:
> Hi Matt,
>
> you could use matrix indexing. Here is a possible solution, which could be
> optimized further (probably).
>
HI all,
Sorry for the title here but I find this difficult to describe succinctly.
Here's the problem.
I want to create a new matrix where each row is a composite of an old
matrix, but where the row & column indexes of the old matrix change for
different parts of the new matrix. For example, the
Hi Matt,
you could use matrix indexing. Here is a possible solution, which could
be optimized further (probably).
# The old matrix
(old.mat <- matrix(1:30,nrow=3,byrow=TRUE))
# matrix of indices
index <- matrix(c(1,1,1,4,
1,3,5,10,
2,2,1,3,
3 matches
Mail list logo