powered by
Fast addition of vector to each row of a matrix. This corresponds to t(t(x) + v)
add_torows(x, v)
A matrix with dimensions n*k.
A vector of length k.
A matrix of dimension n*k where v is added to each row of x
# NOT RUN { A <- matrix(1:12, ncol=3) B <- c(1, 2, 3) add_torows(A, B) # }
Run the code above in your browser using DataLab