I've had this super annoying bug for months now I'm just getting around to asking for help with. For some reason I cannot read in my data from my Rmarkdown file by running the individual line of code in the first chunk. It looks like this:
sonadata=read.csv("sonadata.csv",header = TRUE,na.strings = "")
Even with the correct working directory set and running RStudio as administrator still returns this error message when I try to run this line:
cannot open file 'sonadata.csv': No such file or directoryError in file(file, "rt") : cannot open the connection
If I copy and paste the code directly into the console however, it works just fine. It also works if I copy and paste it into a blank, new script. Every time I try to run it from RMarkdown however, it gives me an error.