Hi

I am doing an simulation, and I a large proportion of the simulation
time is taken up by memory allocations.

I am creating an object, and storing it in a list of those objects.

essentially:

x <- list()
for (t in 1:500) {
 x[1] <- new("track")
}

I would like to initialize in one go, to avoid the continuous
reallocation of memory when a new "track" is added, and fill it wit
the object created by new("track").

How can I do this?

thanks

Rainer


-- 
Rainer M. Krug, Centre of Excellence for Invasion Biology,
Stellenbosch University, South Africa

______________________________________________
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.

Reply via email to