Hi, I am a new user of "R", I am trying to read my data in.. "Cervixhc.dat" used to be in a different directory, now it has been moved to "O:\E&s\APC cervix FINAL (YG,MC,MD)\Manuscript\Data", but when I ran the following program (in red) I got an error message "Error in setwd(dir) : cannot change working directory", and "Error in file(file, "r", encoding = encoding) : unable to open connection In addition: Warning message: cannot open file 'O:E&sAPC cervix FINAL (YG,MC,MD)ManuscriptPrograms t.R', reason 'Invalid argument' " Here is my program: setwd("O:\E&s\APC cervix FINAL (YG,MC,MD)\Manuscript\Data") library(Epi) source("O:\E&s\APC cervix FINAL (YG,MC,MD)\Manuscript\Programs\tt.R") cervix_all<-read.table("cervixhc.dat",header=T) Wonder whether you can help me to solve the problem? Thanks very much! Sincerely, Yanyan =====================================Yanyan Gong, MSc Senior Research Associate Ontario Cervical Screening Program Cancer Care Ontario 620 University Ave, 11th Floor Toronto ON M5G 2L7 (416) 971-9800, ext 3304 yanyan.gong@cancercare.on.ca ===================================== This e-mail message (and any attachments) may contain confid...{{dropped}}
On Thu, 2006-04-13 at 16:28 -0400, Gong, Yanyan wrote:> Hi, > > I am a new user of "R", I am trying to read my data in.. "Cervixhc.dat" used > to be in a different directory, now it has been moved to "O:\E&s\APC cervix > FINAL (YG,MC,MD)\Manuscript\Data", but when I ran the following program (in > red) I got an error message "Error in setwd(dir) : cannot change working > directory", and "Error in file(file, "r", encoding = encoding) : > unable to open connection > In addition: Warning message: > cannot open file 'O:E&sAPC cervix FINAL (YG,MC,MD)ManuscriptPrograms > t.R', reason 'Invalid argument' " > > Here is my program: > > setwd("O:\E&s\APC cervix FINAL (YG,MC,MD)\Manuscript\Data") > > library(Epi) > source("O:\E&s\APC cervix FINAL (YG,MC,MD)\Manuscript\Programs\tt.R") > cervix_all<-read.table("cervixhc.dat",header=T) > > Wonder whether you can help me to solve the problem? Thanks very much! > > Sincerely, > > YanyanSee R for Windows FAQ 2.16 "R can't find my file, but I know it is there!" http://cran.r-project.org/bin/windows/base/rw-FAQ.html#R-can_0027t-find-my-file HTH, Marc Schwartz