RStudio "The system cannot find the file specified whenever I knit

Viewed 12

Whenever I knit to a PDF in RStudio, the error "The system cannot find the file specified."

Here is the code that I'm using: ##importing data library(readr) Quiz1data_2 <- read_csv("C:/Users/erinp/Downloads/Quiz1data-2.csv")

I have restarted RStudio multiple times and I have copied and pasted the exact link that my file is saved to and it's still not working.

What am I not seeing or what am I not thinking?

screenshot of error and code

1 Answers

Some suggestions/questions:

Without knitting, when you run the line reading in the csv, does it work?

Also, are you sure that the error is referring to the data csv? Could it be referring to the (I'm assuming) markdown file you are writing your code in? Have you moved that file since you started working in it?

Are you able to knit other documents to pdf? You need MiKTeX on a windows machine. Does knitting to html work?

I've found R to be a little tricky reading in files. I usually use the base function like this:go to the environment tab>import dataset>from text(base)> (select the file you want, hit open)>(select settings so that the dataframe preview looks right>import. Code that does this will run in the console, and I copy it into my markdown file so that every time it knits, it replicates that successful process.

Related