Error: Unexpected Symbol


I've been trying to import a new data set but it keeps showing the message of "error: unexpected symbol".
This is the code I've been using:
bfi <- read.table(file="~/bfi.csv", sep=",", header=T)bfi

This"bfi" is already in my working directory so I don't know why it cannot be read. Any suggestion would be really helpful!!!

Is this actually at the end of this code line or is a typo in your post? if it is there, then the last "bfi" after the closing parenthesis is the cause of your problem.

1 Like

Thanks for your reply!!

Well, I removed it but now a new message appears:

Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'C:/Users/gemor/OneDrive/Documents/bfi.csv': No such file or directory

Is this the actual location of your file? it is usually better to use relative paths instead of absolute ones. Another thing to consider is that R frequently has problems when working with cloud-synced folders, it is usually safer to work on a local folder instead.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.