alekk wrote: > > 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 just call vect<-rep( func(), N) - I guess that there > also exists a one-liner to do that in R, doesn't it ? >
?runif vect <- runif(N) /Berend -- View this message in context: http://r.789695.n4.nabble.com/vector-creation-tp2308840p2308844.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.