Re: [R] vector creation

2010-07-31 Thread alekk
sorry for being unclear: my function func() is actually more complicated than that, and uses random numbers to generate its result. If I run something like vect = rep(func(), N) I will get something like (x,x,x, ... ,x). What is the right way to do that ? Thanks! -- View this message in

[R] vector creation

2010-07-31 Thread alekk
dear all, consider a simple function like func = function(){ return(runif()) } and say that you would like to create a vector of size N, each entry being a call to this function "func". What is the equivalent of the python code vect = [ func() for i in range(N)] Indeed, you cannot jus