4 ms·
R, the master troll of statistical languages
- jimmyvalmer 7y agoSummary: author shows three ways to extract numeric-only columns from a dataframe, 1. a naive loop, 2. using apply(), and 3. using idiomatic sapply(). Only methods 1 and 3 work as apply() assumes singly-typed vectors (and dataframes can have mixed types). Author is frustrated because 1. there are too many ways to do simple extractions and 2. using apply() is a prime example of "a little knowledge is a dangerous thing." Verbosity is an existential threat.