tompkins <- tompkins |>
mutate(home_age = if_else(year_built < 1960, "Before 1960", "Newer than 1960"))
- 1
- Create a new column of data
- 2
-
Save the modified data frame as
tompkins
Lecture 5
Cornell University
INFO 2950 - Summer 2024
June 5, 2024
tompkins <- tompkins |>
mutate(home_age = if_else(year_built < 1960, "Before 1960", "Newer than 1960"))
tompkins
Avoid long lines of code
Use the tidyverse style guide and styler
Render, commit, and push regularly
ae-03
ae-03
(repo name will be suffixed with your GitHub name).|>
, can be read as “and then”.+
, and indent the next line.