I am trying to create a csv file by on a PC. I have tried a few codes, but it is not coming together. I am new to RStudio. Below is the code and error message. Please help
Data_Frame <- aggregate(all_trips_v2$ride_length ~ all_trips_v2$member_casual + all_trips_v2$day_of_week, FUN = mean)
write.csv(df, file = 'C:/Users/Sabri/OneDrive/Desktop/final/avg_ride_length.csv')
Error in as.data.frame.default(x[[i]], optional = TRUE) :
cannot coerce class ‘"function"’ to a data.frame