# A tibble: 3 × 3
cyl num_cars avg_mpg
<dbl> <int> <dbl>
1 4 11 26.7
2 6 7 19.7
3 8 14 15.1
…and rename()
Ben Baumer
The Five Verbs
select()
filter()
mutate()
arrange()
summarize()
Plus:
group_by()
rename()
inner_join()
left_join()
summarize()
: collapse into a single rowgroup_by()
: group by a variabletake a vector
output a single value
You can rename columns with rename. Here’s The first three rows of mtcars.
mpg cylinders disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1