Hello Helpers, I have an Excel file on my desktop (.csv) which I want to use in my R worksheet, how can I specify the path while using read.csv() ? Savanna -- View this message in context: http://www.nabble.com/Specify-Path-of-an-Excel-file-in-R-tp15530586p15530586.html Sent from the R help mailing list archive at Nabble.com.
Try: X<- read.csv ("<full path file name>") or Y<- read.delim("<full path file name>", sep=",", header=T) Example, if your file is in C-directory, file name is my_file, and the file has a header. X<- read.csv("c:\\my_file") or Y<- read.delim("c:\\my_file", sep=",", header=T) My D. Coyne -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of savanna3000 Sent: Sunday, February 17, 2008 10:53 AM To: r-help at r-project.org Subject: [R] Specify Path of an Excel file in R Hello Helpers, I have an Excel file on my desktop (.csv) which I want to use in my R worksheet, how can I specify the path while using read.csv() ? Savanna -- View this message in context: http://www.nabble.com/Specify-Path-of-an-Excel-file-in-R-tp15530586p15530586 .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.
One way that works for lazy people like me is to use file.choose(). 1) Type in "file.choose()" without the quotes and hit <enter> 2) Navigate to the folder and file that you want and click on it. 3) R will show you the complete path to your file. An even easier way is to do something like this: my.stuff <- read.csv(file.choose(), ... and then navigate to your file. Charles Annis, P.E. Charles.Annis at StatisticalEngineering.com phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of savanna3000 Sent: Sunday, February 17, 2008 10:53 AM To: r-help at r-project.org Subject: [R] Specify Path of an Excel file in R Hello Helpers, I have an Excel file on my desktop (.csv) which I want to use in my R worksheet, how can I specify the path while using read.csv() ? Savanna -- View this message in context: http://www.nabble.com/Specify-Path-of-an-Excel-file-in-R-tp15530586p15530586 .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.