dplyr::select() Accepts Characters Since Version 0.7.0

October 25, 2017

Some of my friends didn’t aware that dplyr now accepts characters. Did you? For example, this expression select(iris, Sepal.Length, Petal.Length) can be also written in this way: select(iris, "Sepal.Length", "Petal.Length") or in this way: select(iris, c("Sepal.Length", "Petal.Length")) For the semantics of select(), you can find a good explanation in the vignette. Tidyeval? You may want to write some code that selects columns programmatically using variables. x <- c("col1", "col2") select(some_data, x) But, be fareful, x can be ambiguous. ... Read more