2

Unexpected symbol error in R. Please see below:

Error: unexpected symbol in infants.csv <- read.csv("C:\\Users\\alcos001\\Desktop\\Data for PubH7405\\infants.csv" header=TRUE)

I'm totally lost to what the unexpected symbol is. Does anyone see it? is it a typo or the wrong command?

Thanks

2
  • You're using \` or /` as a folder separator, right? Even though Windows uses `, it is an escape character in R, so you can't write read.csv("C:\Users\alcos001\Desktop\Data for PubH7405\infants.csv" header=TRUE), just read.csv("C:\\Users\\alcos001\\Desktop\\Data for PubH7405\\infants.csv" header=TRUE)` or read.csv("C:/Users/alcos001/Desktop/Data for PubH7405/infants.csv" header=TRUE). Oct 11, 2013 at 0:01
  • 4
    It's the extra double quote near the end. Edit: now its the lack of comma
    – Sean Owen
    Oct 11, 2013 at 0:06

1 Answer 1

8

You are missing a comma in your function call. Should read

read.csv("C:/Users/alcos001/Desktop/Data for PubH7405/infants.csv", header=TRUE)

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.