October 2017
Beginner to intermediate
236 pages
7h 38m
English
Let's take a look at the following steps to see how we can use the filter() verb for data processing:
USAairlineData2016 <- read.csv("USAairlineData2016.csv", as.is = T) filterExample <- USAairlineData2016 %>% filter(DEP_DELAY>30)
filterExample2 <- filter(USAairlineData2016, DEP_DELAY>30)
filterExample3 <- USAairlineData2016 [USAairlineData2016$DEP_DELAY>30,]
However, the base R approach takes a bit longer than the dplyr approach.