Hello everybody,

Without any loop and any package,

I would like to return N products of M rows in a matrix A :

Today, I managed to do it with a loop :

B <- matrix(NA, ncol = ncol(A), nrow = 0)
for (i in 1 : N) B <- rbind(B, apply(A[sample(1 : nrow(A), M, replace = T),
], 2, prod))

Do you have a solution ?

Thank you in advance !

	[[alternative HTML version deleted]]

