Error in filter

bike_rides1 <- bike_rides %% filter(Minutes >0) %% drop_na()
Error in filter(Minutes > 0) : object 'Minutes' not found

Hello, I'm trying to use this filter but, I'm unable to execute the code to drop the 0s and the empty fields. I saw in one video that this code worked perfectly fine but I keep getting an error message. Can anyone help please?
Thank you!!

Calculate Trip Duration

bike_rides$Hours <- difftime(bike_rides$ended_at,bike_rides$started_at,units = c("hours"))
bike_rides$Minutes <- difftime(bike_rides$ended_at,bike_rides$started_at,units = c("mins"))
bike_rides1 <- bike_rides %% filter(Minutes >0) %% drop_na()

The magrittr pipe operator is %>%, not %%.

1 Like

Thank you so much for the answer. Solved!

This topic was automatically closed 7 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.