Replies: 9 comments 18 replies
-
Week 1: FunctionsLexical scoping may cause issues when users try to "functionalize" their code. Consider for example:
Users may put the script and derivations in functions:
But this fails due to lexical scoping:
Possible Actions:
|
Beta Was this translation helpful? Give feedback.
-
So this is where I have always been lost with the environments here admiral/R/admiral_environment.R Line 14 in d5048cb Why are we creating an empty environment? Isn't it already available as 7.2.3 says every environment has a Parent and the search path terminates with the empty environment |
Beta Was this translation helpful? Give feedback.
-
Do we create an R6 object as discussed in 7.6? Would that help us with some of our environment issues? |
Beta Was this translation helpful? Give feedback.
-
Line 128 in 269e021
This looks similar to section 7.3 Recursing over Environments - maybe a good discussion item as it is in context of admiral |
Beta Was this translation helpful? Give feedback.
-
For package loading - I've always "attached" packages in the beginning of the script just so it was clean, but reading 7.4.1 it feels like this is more important as if mid-script you "attach" other library the global environment changes |
Beta Was this translation helpful? Give feedback.
-
Just putting these here to discuss at next EWG |
Beta Was this translation helpful? Give feedback.
-
Holiday Reading !?? Many years ago, one of my freshman college roommates walked in the door speaking high praises for LISP. "So that's what R is trying to do!" Seems that LISP is cleaner way to introduce the Then I read a chapter of this book and it too greatly helped with R. More light bulbs went on. Metaprogramming in R More from Thomas Mailund: |
Beta Was this translation helpful? Give feedback.
-
How R finds a dataset? A month or so a ago we agreed to use the syntax:
Example, if one remembers the package (and spells it correctly)
I don't quite understand the mechanism that serves up the dataset. It is not exported object, I tried to find it in the NS of the package (had much trouble with this). And we are using lazyload which has some affect on datasets, but I remain puzzled. |
Beta Was this translation helpful? Give feedback.
-
This code came up today as an example of operator precedence.
I suggest another way to look at this code, equivalent. Mentally (or with lobstr::ast) break up this code into a list of one function followed by its arguments ( I think the list way of looking at R can simplify otherwise messy contructions. (https://github.com/jimrothstein/try_things_here/blob/main/NSE_project/900_not_function.md) |
Beta Was this translation helpful? Give feedback.
-
Book Club Advanced R
Week 1: https://adv-r.hadley.nz/functions.html (Stefan)
Week 2: https://adv-r.hadley.nz/environments.html (Daniel)
Week 3: https://adv-r.hadley.nz/metaprogramming.html & https://adv-r.hadley.nz/meta-big-picture.html (Edoardo)
Week 4: https://adv-r.hadley.nz/expressions.html (Ben)
Week 5: https://adv-r.hadley.nz/quasiquotation.html
Week 6: https://adv-r.hadley.nz/evaluation.html
Week 7: Dive in to applications in {admiral}
Beta Was this translation helpful? Give feedback.
All reactions