Replies: 1 comment
-
|
I've seen a similar looping issue before and I totally agree that this is not an uncommon thing to want to do. I'll have a closer look at this and I suspect it's a gt problem. Will create an issue from this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I recently discovered an interesting (in hindsight) problem. Consider you want to make a simple 3x3 table containing NAs. Now you want to add 1,2,3 under the 3 respective diagonal elements of the table.
What I tried:
However, add "3" to all diagonal elements of the table. This SO Thread suggests points out that R's lazy evaluation is messing things up here. The SO Thread also contains a solution > using
lapply.So there are some problems I see:
lapplyor apply or something. But translating loops intolapplycalls is not always easy, especially if you deal with nested loops.I think looping through (part of) a table is a relatively common scenario. Is there something we can do about this? So for example can we force non-lazy evaluation inside of for-loops?
Let's Discuss! :)
Beta Was this translation helpful? Give feedback.
All reactions