[R] Importing a CSV file

MacQueen, Don macqueen1 at llnl.gov
Fri Feb 10 20:31:30 CET 2012


I think you must have given the path to the file wrong.

Assuming you are using R.app, try

  infile <- file.choose()

And then give infile to the read.csv() function.

Then print the value of infile to find out what the path really is.

Probably, you wanted
  '/Users/sezginozcan/Downloads/beer.data.csv'

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 2/9/12 7:20 PM, "sezgin ozcan" <szgozcan at gmail.com> wrote:

>I have been trying to import a csv file to r. but I get the same message
>everytime. the message is
>
>Error in file(file, "rt") : cannot open the connection
>In addition: Warning message:
>In file(file, "rt") :
>  cannot open file 'Users:/sezginozcan/Downloads/beer.data.csv': No such
>file or directory
>
>I use mac.
>I tried this command also
>a<-read.table("clipboard",sep=”\t”,row.names=1,header=T)
>Error: unexpected input in "a<-read.table("clipboard",sep=‚"
>
>I will appreciate if you help me before I get crazy.
>thank you
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list