Skip to content

seq(along= surprise

4 messages · Kjetil Halvorsen, Uwe Ligges, Baptiste Auguie

#
Kjetil Halvorsen wrote:
What is surprising?

sims is now a list that contains 1 element called "length" with a 
numeric value of 100.
Then seq(along=sims) is exactly 1, because sims has length 1.
Hence i is printed once (1 iteration of the loop) and is 1 in the first 
(and only) iteration.

Uwe
#
Uwe Ligges wrote:
I should have added that you probably want

sims <- vector(mode="list", length=100)

Uwe
#
Perhaps this is what was intended?
seq by itself does not expect a list, but do.call() can create the  
appropriate call if a list is what you want to pass to the function.

Hope this helps,

baptiste
On 5 Feb 2009, at 19:46, Uwe Ligges wrote:

            
_____________________________

Baptiste Augui?

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag