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: Expression time_diff_minutes(pickup_datetime, dropoff_datetime) not supported in Arrow
Call collect() first to pull data into R.