4 ms·
You didn't get my example -- it was about how to make a matrix from the results of a non-vectorised function that gets one number and returns a vector (say perf
by mbq 14y ago
You didn't get my example -- it was about how to make a matrix from the results of a non-vectorised function that gets one number and returns a vector (say performs a complex simulation).
The problem you've solved has an equally simple implementations in R; f(1:10) for a single copy, matrix(f(1:10),10,n) for n columns, matrix(f(1:10),n,10,byrow=T) for n rows, etc.