time_diff_minutes <- function(pickup, dropoff){
difftime(dropoff, pickup, units = "mins") |>
round() |>
as.integer()
}
nyc_taxi |>
mutate(
duration_minutes = time_diff_minutes(pickup_datetime, dropoff_datetime)
) |>
select(pickup_datetime, dropoff_datetime, duration_minutes) |>
head() |>
collect()
Error in `time_diff_minutes()`:
! `difftime()` with units other than `secs` not supported in Arrow
→ Call collect() first to pull data into R.