- 1
-
The first argument is the data frame we want to operate on (in this case,
hrs_data) - 2
-
selectis the function we are using on the data frame - 3
-
ageandedare the columns (in the data frame) that we perform theselect()function on
dplyr basicsdplyr is a package in the tidyverse that provides a set of functions for data manipulation and transformation
dplyr is like a verb that describes the action being performed on the data
dplyr have similar input and output:
dplyr function: select()I can use the select() function to select specific columns (age_yr and ed) from my data frame (hrs_data)
hrs_data)
select is the function we are using on the data frame
age and ed are the columns (in the data frame) that we perform the select() function on
age_yr ed
1 55 NA
2 56 12
3 55 NA
4 50 16
5 71 16
6 52 17
7 62 11
8 51 13
9 70 16
10 56 NA
dplyr functionsdplyr functions can be categorized into four groups based on what they operate on:
filter(), slice()select(), mutate()group_by(), summarize()left_join(), inner_join()Intro to data transformations and summarizations