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)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.