dplyr Doesn't Provide Full Support For S4 (For Now?)

February 12, 2018

I’ve seen sooo many (duplicated) issues on this topic were opened on dplyr’s repo and lubridate’s repo. For example, you cannot filter() intervals. Consider the data below: library(lubridate) #> Loading required package: methods #> #> Attaching package: 'lubridate' #> The following object is masked from 'package:base': #> #> date library(dplyr, warn.conflicts = FALSE) # some method of tibble() won't work for interval d <- data.frame( i = interval(ymd(10000101) + years(1:3 * 1000), ymd(10000102) + years(1:3 * 1000)), value = 1:3 ) d #> i value #> 1 2000-01-01 UTC--2000-01-02 UTC 1 #> 2 3000-01-01 UTC--3000-01-02 UTC 2 #> 3 4000-01-01 UTC--4000-01-02 UTC 3 Let’s select the second row by filter(). ... Read more

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