Rhas a very powerful array slicing ability that allows for some very slick data processing.
Suppose we have a
d“, and for every row where
d$n_observations < 5we wish to “
NA-out” some other columns (mark them as not yet reliably available). Using slicing techniques this can be done quite quickly as follows.library("wrapr") d[d$n_observations < 5, qc(mean_cost, mean_revenue, mean_duration)] <- NA
Read on for more. In general, I prefer the pipeline mechanics offered with the Tidyverse for readability. But this is a good example of why you should know both styles.