[R] I might be dumb : a simple question about "foreach"

Daya Atapattu daya at revolution-computing.com
Thu Jul 23 21:55:57 CEST 2009


This problem is due to a bug in the iterators package.
It has been fixed in version 1.0.2 of iterators, which is
on CRAN now.

- Daya

Daya Atapattu
Revolution Computing


Olivier ETERRADOSSI wrote:
> Many thanks David for making the connection betweeen the two reports.
> If I understand, other french users may have faced the same problem...
> However I'll wait until it's solved to have a look at "foreach".
> Regards. Olivier
>
> David M Smith a écrit :
>> A user in Japan reported a similar problem on the Revolutions blog ( 
>> http://bit.ly/FKP2I ), and my best guess is that it's an 
>> (unintended!) effect of using locales. The developers in New Haven 
>> are looking at it, and I expect they'll be able to post an update to 
>> CRAN soon.
>>
>> # David Smith
>>
>> On Mon, Jul 20, 2009 at 5:48 AM, Olivier ETERRADOSSI 
>> <Olivier.Eterradossi at ema.fr <mailto:Olivier.Eterradossi at ema.fr>> wrote:
>>
>>     Hi list,
>>     My attention was drawn to the foreach package by recent posts...I
>>     decided to have a look...
>>     I'm using R.2.9.1 on Windows, I have downloaded the foreach
>>     package today (v 1.2.1), together with iterators (v. 1.0.1) and
>>     codetools (v.0.2-2).
>>     Full of hope I try the most simple thing of all out of the package
>>     vignette :
>>
>>          x <- foreach(i = 1:3) %do% sqrt(i)
>>
>>     and get :
>>
>>         Erreur dans sqrt(i) : indice hors limites ( i.e. "error in
>>         sqrt(i) : index out of bounds")
>>
>>     but when trying :
>>
>>         x<-foreach(i = 1:3) %do% print(sqrt(i))
>>
>>     I get :
>>
>>         [1] 1
>>         [1] 1.414214
>>         [1] 1.732051
>>         Erreur dans print(sqrt(i)) : indice hors limites
>>
>>     Probably I didn't drink enough coffee this morning and I'm still
>>     asleep : it is obvious that  I miss a point... but I am unable to
>>     see which one.
>>     Any help appreciated ! Many thanks, and very best regards Olivier
>>
>>     --     Olivier ETERRADOSSI
>>     Maître-Assistant
>>     CMGD / Equipe "Propriétés Psycho-Sensorielles des Matériaux"
>>     Ecole des Mines d'Alès
>>     Hélioparc, 2 av. P. Angot, F-64053 PAU CEDEX 9
>>     tel std: +33 (0)5.59.30.54.25
>>     tel direct: +33 (0)5.59.30.90.35 fax: +33 (0)5.59.30.63.68
>>     http://www.ema.fr
>>
>>     ______________________________________________
>>     R-help at r-project.org <mailto:R-help at 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.
>>
>>
>>
>>
>> -- 
>> David M Smith <david at revolution-computing.com 
>> <mailto:david at revolution-computing.com>>
>> Director of Community, REvolution Computing 
>> www.revolution-computing.com <http://www.revolution-computing.com>
>> Tel: +1 (206) 577-4778 x3203 (San Francisco, USA)
>>
>> Check out our upcoming events schedule at 
>> www.revolution-computing.com/events 
>> <http://www.revolution-computing.com/events>
>>
>




More information about the R-help mailing list