Re: [R] replace values in array with means of certain values in array

2011-01-10 Thread Petr Savicky
On Mon, Jan 10, 2011 at 03:21:18PM +0100, joke R wrote: > Dear all, > > I have a problem with arrays. > Simplified, I have two arrays: > > A = > [,,1] > 1 2 3 > 4 5 6 > 7 8 9 > > [,,2] > 10 11 12 > 13 14 15 > 16 17 18 > > B= > 1 1 2 > 1 1 2 > 3 3 2 > > Basically,

[R] replace values in array with means of certain values in array

2011-01-10 Thread joke R
Dear all, I have a problem with arrays. Simplified, I have two arrays: A = [,,1] 1 2 3 4 5 6 7 8 9 [,,2] 10 11 12 13 14 15 16 17 18 B= 1 1 2 1 1 2 3 3 2 Basically, B declares to which cluster the values of A belong to. Now I want an array C where for each cluster