[R] Can anyone help??

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 16 19:59:07 CET 2008


FAQ Q 7.8
rw-FAQ Q 2.16

should both help, as perhaps should the warning about

> unrecognized escape removed from "C:\onlinesurvey.csv"

You need to use forward slashes or double the backslashes.

On Wed, 16 Jan 2008, hoogeebear wrote:

>
> Hi,
>
> Im getting the following error when I attempt to read a csv file into R. I
> have the file saved on my C drive. Id really appreciate it if anyone can
> help....
>
> My Command:
>
>> survey <- read.csv (file = "C:\onlinesurvey.csv",head= TRUE, sep =",")

sep = "," is the default (the 'c' in csv stands for 'comma')

> Error:
>
> Error in file(file, "r") : unable to open connection
>
> In addition: Warning messages:
> 1: '\o' is an unrecognized escape in a character string
> 2: unrecognized escape removed from "C:\onlinesurvey.csv"
> 3: In file(file, "r") :
>  cannot open file 'C:onlinesurvey.csv', reason 'No such file or directory'
>
> I have the file located on the C drive so I do not know why its telling me
> "no such file or directiry".
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list