Working with Big Data inR | 203
Warning message:
Unknown variables: `buff1`, `buff2`
# Functions to select specific rows
>filter(data, cylinders == 8)#selects rows based on conditions
>filter(data, cylinders == 8, model.year> 75)
In R language, pipe (%>%) operator allows to pipe the output from one function to the input
of another function. Instead of nesting functions (reading from the inside to the outside), the
idea of piping is to read the functions from left to right.
> data %>% select(2:7) %>% filter(cylinders == 8, model.year> 75)
%>% head(3)
cylinders
1
2
3
displacement horsepower weight acceleration model.year
8
8
304
307
150
200
140
12
15
3433
4376
> arrange(data,model.year) #Sorts ascending rows by a feature