[R] Importing a CSV file

David L Carlson dcarlson at tamu.edu
Fri Feb 10 17:04:00 CET 2012


First, make sure the file name is correct.

Second, try 

list.files("Users:/sezginozcan/Downloads/")

to see if the file is listed and you are looking in the correct folder.

Third, you may be able to locate and open the file using

A <- read.table(file.choose(), sep="\t", row.names=1, header=T)

I believe that "clipboard" works only on Windows computers.

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of sezgin ozcan
Sent: Thursday, February 09, 2012 9:21 PM
To: r-help at stat.math.ethz.ch
Subject: [R] Importing a CSV file

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