0
$\begingroup$

I have question regarding a project I have to do about a health student study. I cannot import the csv file via read.csv or read.csv2 despite having transformed all files to csv and being in the correct folder. Here are the command lines:

setwd ("C:/Users/fek/Desktop/Analyse i-Share")
getwd()
TA<-read.csv2(file=Biobanque.csv, header=TRUE, sep=",", dec=",", fill=TRUE)

And here are the results in the console window:

setwd ("C:/Users/fek/Desktop/Analyse i-Share")

getwd()

[1] "C:/Users/fek/Desktop/Analyse i-Share"

TA<-read.csv2(file=Biobanque.csv, header=TRUE, sep=",", dec=",", fill=TRUE)

[1] Error in read.table(file = file, header = header, sep = sep, quote = quote, : objet 'Biobanque.csv' introuvable

To translate from french, it says it can't find the file!

$\endgroup$
0

1 Answer 1

4
$\begingroup$

The problem is just what it says. By omitting the quotes around "Biobanque.csv", R thinks you are talking about an object whose name is Biobanque.csv. And R is confused because of course you have not created an object by that name.

$\endgroup$
1
  • $\begingroup$ This is correct - the error message states that R cannot find the object 'Biobanque.csv', not that it cannot find the file 'Biobanque.csv' (which would give the error "No such file or directory"). $\endgroup$ Commented Jun 29, 2020 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.