Hello community,
I am Mrinal, a Public Health Researcher, from India.
I am currently revising through r4ds (2e) and came by ".by". But the behaviors seems inconsistent. Or may be I am ignorant enough to not able to detect my human anomaly. Please help.
flights |>
select(carrier, dest, dep_delay, arr_delay) |>
group_by(dest, carrier) |>
summarise(
add = mean(dep_delay, na.rm = T)
) |>
arrange((dest)) |>
slice_max(add, n =1)
flights |>
select(carrier, dest, dep_delay, arr_delay) |>
summarise(
add = mean(dep_delay, na.rm = T),
.by = c(dest, carrier)
)|>
arrange((dest)) |>
slice_max(add, n =1)

