March 2018
Beginner to intermediate
570 pages
13h 42m
English
As we did in the last section, let’s start in earnest by learning how to subset our data by condition. For this, we use dplyr’s filter function which takes an expression that returns a logical vector:
> tracks %>% filter(artist=="Belle and Sebastian")> tracks %>% filter(artist=="Belle and Sebastian" | artist=="The Smiths")> tracks %>% filter(artist %in% c(“Belle and Sebastian", "The Smiths"))> tracks %>% filter(artist=="Belle and Sebastian" & trackname=="The Model")

Really simple stuff so far!
Where we previously used the order function in the i field to sort by a column, the dplyr way is to use the arrange function:
> tracks ...