[R] r noobie, reading my text file into r

Conklin, Mike (GfK) Mike.Conklin at gfk.com
Thu Feb 6 20:23:51 CET 2014


When starting out I sometimes find it easier to do the following:

Ceosalary<-read.table(file.choose(),sep="\t")

This will give you a dialog box to find the file you want and you won't have to worry about getting the full path exactly right. 

Hth,

Mike

W. Michael Conklin
Executive Vice President | Marketing Science
GfK Custom Research, LLC | 8401 Golden Valley Road | Minneapolis, MN, 55427 
T +1 763 417 4545 | M +1 612 567 8287 
www.gfk.com 



-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of frankreynolds
Sent: Thursday, February 06, 2014 12:01 PM
To: r-help at r-project.org
Subject: [R] r noobie, reading my text file into r

Hi everyone, this is my first time using r and I think I'm overlooking something small and I just need some help seeing it. I have a file in notepad that I need to read into r.
> ceosalary<-read.table(file="C:/Users/mz106_010/Desktop/ceosalary.csv",
> header
> = TRUE,sep="\t")
Error in file(file, "rt") : cannot open the connection In addition: Warning message:
In file(file, "rt") :
  cannot open file 'C:/Users/mz106_010/Desktop/ceosalary.csv': No such file or directory
> ceosalary<-read.table(file="C:/Users/mz106_010/Desktop/ceosalary.txt",
> header
> = TRUE,sep="\t")
Error in file(file, "rt") : cannot open the connection In addition: Warning message:
In file(file, "rt") :
  cannot open file 'C:/Users/mz106_010/Desktop/ceosalary.txt': No such file or directory

am I writing one of those incorrectly? What can I do to fix the problem? Any help would be greatly appreciated.  Thanks for your time everyone!



--
View this message in context: http://r.789695.n4.nabble.com/r-noobie-reading-my-text-file-into-r-tp4684871.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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