Update logicals - case_when - reorder arguments (#1167)

This commit is contained in:
Robin Penfold 2022-12-04 20:30:56 +00:00 committed by GitHub
parent 1ffbbf90b5
commit 5750b23270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -535,11 +535,11 @@ flights |>
mutate(
status = case_when(
is.na(arr_delay) ~ "cancelled",
arr_delay > 60 ~ "very late",
arr_delay > 15 ~ "late",
abs(arr_delay) <= 15 ~ "on time",
arr_delay < -15 ~ "early",
arr_delay < -30 ~ "very early",
arr_delay < -15 ~ "early",
abs(arr_delay) <= 15 ~ "on time",
arr_delay > 15 ~ "late",
arr_delay > 60 ~ "very late",
),
.keep = "used"
)