On Tue, 08 Feb 2005 11:36:29 +0100, Eric Lecoutre
<[EMAIL PROTECTED]> wrote :

>Note though that if you are planning some simulations, many guRus would say 
>that you should use a list.
>
>nsimul <- 100
>simOut <- vector(mode="list",length=nsimul)
>names(simOut) <- paste("simu",1:nsimul,sep="")
>
>for (i in 1:nsimul){
>         ###
>         simOut[i]<- resultsofsimulation.i
>         ###
>}

Be careful with those brackets:  that should almost certtainly be
simOut[[i]], putting resultsofsimulation.i into the i'th position of
simOut.

Your syntax would put resultsofsimulation.i[[1]] into that place, and
that's not usually what one wants.

Duncan Murdoch

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to