0

I am just wondering if apply is faster than a for loop for a matrix?

Currently, I have a function that works on vector. I would like to use this function for every row in the matrix, with each row acting as a vector.

If not, I am wondering if there is a vectorized form or paralleization way of applying a function that treats each column as a element in the vector?

I tried apply(), but it seems that it is the same as the for loop in terms of time.

Texas2022
  • 7
  • 2

0 Answers0