cannot open file 'C:/Users/ADHP-GCRO/Documents/Desktop/Divvy_Exercise/avg_ride_length.csv': No such file or directory

# If you are working on a PC, change the file location accordingly (most likely "C:\Users\YOUR_USERNAME\Desktop\...") 
> #to export the data.
> counts <- aggregate(all_trips_v2$ride_length ~ all_trips_v2$member_casual + all_trips_v2$day_of_week, FUN = mean)
> write.csv(counts, file = '~/Desktop/Divvy_Exercise/avg_ride_length.csv')
Error in file(file, ifelse(append, "a", "w")) : 
  cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
  cannot open file 'C:/Users/ADHP-GCRO/Documents/Desktop/Divvy_Exercise/avg_ride_length.csv': No such file or directory

The Desktop is not usually a sub folder of Documents. Try
``
write.csv( 'C:/Users/ADHP-GCRO/Desktop/Divvy_Exercise/avg_ride_length.csv')

Thank you, I just ran the code and nothing happen. Guess it worked

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.