Knitting of the R markdown halted when it reached the code below and threw the error message below.
# Calculate average duration in minutes by user type and trip duration
bike_data$average_duration_minutes <- ave(bike_data$trip_in_minutes,
list(bike_data$user_type,
bike_data$trip_in_minutes),
FUN = mean)
I keep getting this error message when I try to knit the R markdown, please help.
Error in split. Default(x, g) : group length is 0 but data length > 0 Calls: ... eval -> eval -> ave -> lapply -> split -> split.default Execution halted.
I tried to check the code for typo error but everything seems ok. But I keep getting the same error. Any help will be appreciated.