Re: [R] [EXT] Initializing vector and matrices

2024-02-29 Thread Steven Yen
Hello Eik: Thanks. I do not need to sample. Essentially, I have a do loop which produces 24 vectors of length of some length (say k=300) and 24 matrices of 300x300. Then, I simply need to  take the averages of these 24 vectors and matrices: x=(x1+x2+...+x24)/k y=(y1+y2+...+y24)/k I am

Re: [R] [EXT] Initializing vector and matrices

2024-02-28 Thread Eik Vettorazzi
Hi Steven, It's not entirely clear what you actually want to achieve in the end. As soon as you "know" x1, and assuming that the different "xi" do not differ in length in the real application, you know the length of the target vector. Instead of the loop, you can use 'Reduce' without having to