R Tip: Break up Function Nesting for Legibility
RTools & LanguagesProgramming Language|Rposted by John Mount March 30, 2018
There are a number of easy ways to avoid illegible code nesting problems in R. In this R tip we will expand upon the above statement with a simple example. At some point it becomes illegible and undesirable to compose operations by nesting them, such as in the following... Read more
Is R base::subset() really that bad?
RTools & LanguagesProgramming Language|Rposted by John Mount March 7, 2018
Is R base::subset() really that bad? Notes discussing subset() often refer to the following text (from help(subset), referred to in examples: 1, 2): Warning This is a convenience function intended for use interactively. For programming it is better to use the standard sub-setting functions like [, and in particular the non-standard evaluation of argument subset can have... Read more
R Tip: Use qc() For Fast Legible Quoting
RTools & LanguagesProgramming Language|Rposted by John Mount February 28, 2018
Here is an R tip. Need to quote a lot of names at once? Use qc(). This is particularly useful in selecting columns from data.frames: library("wrapr") # get qc() definition head(mtcars) # mpg cyl wt # Mazda RX4 21.0 6 2.620 # Mazda RX4 Wag 21.0 6... Read more