How to not fall into R's 'lazy evaluation trap'

后端 未结 4 973
执念已碎
执念已碎 2021-02-04 05:40

\"R passes promises, not values. The promise is forced when it is first evaluated, not when it is passed.\", see this answer by G. Grothendieck. Also see this question referring

4条回答
  •  花落未央
    2021-02-04 06:25

    There is some work in progress to improve R's higher order functions like the apply functions, Reduce, and such in handling situations like these. Whether this makes into R 3.2.0 to be released in a few weeks depend on how disruptive the changes turn out to be. Should become clear in a week or so.

提交回复
热议问题