Hello, I have a dataframe, df. I have two columns of datatype POSIXct: df$started_at and df$ended_at. I want to make a column, df$ride_length, that tells the difference between these two.
I have the library(dplyr) loaded, and tried to do this, but it didn't work:
df %>% mutate(df$ride_length = df$ended_at - df$started_at)
Examples of the format are:
How would you go about this? Thanks as always community!