Message-ID: <4DAEDAE6.9070100@gmail.com>
Date: 2011-04-20T13:08:54Z
From: Duncan Murdoch
Subject: lapply sequence
In-Reply-To: <BANLkTik6QpYSG2hpyBcSDX76e8p8KJ1bNw@mail.gmail.com>
On 20/04/2011 7:26 AM, Dean Marks wrote:
> Good day,
>
> My question is: Does the lapply function guarantee a particular sequence in
> which elements are mapped? And, are we guaranteed that lapply will always be
> sequential (i.e. never map elements in parallel) ?
No.
> The reason I ask is if I use lapply with the mapping function set to
> something that has side-effects that need to be executed in a particular
> sequence.
Use a for loop.
> If this is not possible, is there an alternate method other than using a for
> loop?
while or repeat.
Duncan Murdoch