When I'm calling any read.___() function in R it is looking at the wrong file path. I have tried changing the working directory multiple times and it keeps going to the same path. For example I'm trying the following:
setwd("C:/OneDrive/")
read.csv("~/Desktop/Data/file.csv")
I then get the following error:
Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file 'C:/OneDrive/Documents/Desktop/Data/file.csv': No such file or directory
For some reason the read() function adds the documents folder in place of the specified working directory. I tried uninstalling and deleting all files related to R on my computer then reinstalling. I still get the same issue. I've seen others ask a similar question, but everyone keeps telling them to set the working directory to something different. It doesn't matter what I set the working directory to. R keeps adding the Documents folder into the path. How do I get it to stop adding the Documents folder?