R package has several places where the user can ask for what they have typed in to be substituted for a name or value stored in a variable.
This becomes important as many of the
rquery commands capture column names from un-executed code. So knowing if something is treated as a symbol/name (which will be translated to a
data.frame column name or a database column name) or a character/string (which will be translated to a constant) is important.
Continue reading rquery Substitution
Recently ran into something interesting in the
R macros/quasi-quotation/substitution/syntax front:
Romain François: “.@_lionelhenry reveals planned double curly syntax At #satRdayParis as a possible replacement, addition to !! and enquo()”
!! is no longer the last word in substitution (it certainly wasn’t the first).
Continue reading More on Macros in R
One thing that is sure to get lost in my long note on macros in
R is just how concise and powerful macros are. The problem is macros are concise, but they do a lot for you. So you get bogged down when you explain the joke.
Let’s try to be concise.
Continue reading Parameterizing with bquote
R tip : how to pass a
Often when modeling in
R one wants to build up a formula outside of the modeling call. This allows the set of columns being used to be passed around as a vector of strings, and treated as data. Being able to treat controls (such as the set of variables to use) as manipulable values allows for very powerful automated modeling methods.
Continue reading R Tip: How to Pass a formula to lm