# >
Selecting columns
For these exercises, we’ll use the iris
data set build into base R.
- View
iris
to see what it looks like.
- Return a data frame with only the sepal columns using inclusion.
# >
- Return a data frame with only the sepal columns using a helper function.
# >
- Return a data frame with the sepal and petal columns using a helper function.
# >
- Return a data frame with the sepal and petal columns using exclusion.
# >
- Move
Species
to be the first column usingselect()
and a helper function.
# >
- Move
Species
to be the first column usingrelocate()
.
# >
- Rename
Species
tospecies
usingselect()
and a helper function.
# >
- Rename
Species
tospecies
usingrename()
.
# >