Error: Error in `$<-.data.frame`(`*tmp*`, ride_length, value = numeric(0)) : replacement has 0 rows, data has 5667717

I want to add the column ride_length but this erroe is showing in Rstudio, please guide me

code: all_trips$ride_length <- difftime(all_trips$endded_at,all_trips$started_at)

Error:
Error in $<-.data.frame(*tmp*, ride_length, value = numeric(0)) :
replacement has 0 rows, data has 5667717

I doubt there is a column named endded_at. It is probably named ended_at.

all_trips$ride_length <- difftime(all_trips$ended_at,all_trips$started_at)