Dear friends. I have trobpe with path. Below I have tried to paste a path and file name but it will not work> path <- "D:/rw0641/own/own/procedures/GFR_TIME" > path[1] "D:/rw0641/own/own/procedures/GFR_TIME"> path1 <- paste(path,"gfr.txt",sep="/") > path1[1] "D:/rw0641/own/own/procedures/GFR_TIME/gfr.txt" -- this is good enough> data <- read.table("D:/rw0641/own/own/procedures/GFR_TIME/grf.txt",h=T) > dat1 <- read.table(path1,h=T)Error: "scan" can't open file but doesn't work> path1[1] "D:/rw0641/own/own/procedures/GFR_TIME/gfr.txt" although the path is OK - the unpasted variant is of course ok. What happened ?> dataday month year crea 1 12 3 94 140 2 25 9 95 144 3 3 7 96 167 4 5 12 96 174 5 12 3 97 187 6 14 6 97 188 7 23 9 97 201 Troels Ring, MD Department of Nephrology Aalborg Hospital Aalborg Denmark -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Troels Ring" <tring at mail1.stofanet.dk> writes:> > path <- "D:/rw0641/own/own/procedures/GFR_TIME" > > path > [1] "D:/rw0641/own/own/procedures/GFR_TIME" > > path1 <- paste(path,"gfr.txt",sep="/") > > path1 > [1] "D:/rw0641/own/own/procedures/GFR_TIME/gfr.txt" > -- this is good enough > > data <- read.table("D:/rw0641/own/own/procedures/GFR_TIME/grf.txt",h=T) > > dat1 <- read.table(path1,h=T) > Error: "scan" can't open file > but doesn't work > > path1 > [1] "D:/rw0641/own/own/procedures/GFR_TIME/gfr.txt" although the path is OK > - the unpasted variant is of course ok. What happened ?Strange. Just for completeness, does it work like this? path1<-"D:/rw0641/own/own/procedures/GFR_TIME/grf.txt" dat1 <- read.table(path1,h=T) If it does, the trouble is in paste, otherwise in read.table... And, what happens if you replace every / with \\ ? -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I'm sorry I made a mistake with the file name, mixing gfr and grf. Thanks to P Dalgaard. Now it's OK Troels Ring, MD Department of Nephrology Aalborg Hospital Aalborg Denmark ----- Oprindelig meddelelse ----- Fra: Troels Ring <tring at mail1.stofanet.dk> Til: R-help <r-help at stat.math.ethz.ch> Sendt: 27. juni 1999 20:56 Emne: [R] paste and path ?> Dear friends. I have trobpe with path. > Below I have tried to paste a path and file name but it will not work > > > path <- "D:/rw0641/own/own/procedures/GFR_TIME" > > path > [1] "D:/rw0641/own/own/procedures/GFR_TIME" > > path1 <- paste(path,"gfr.txt",sep="/") > > path1 > [1] "D:/rw0641/own/own/procedures/GFR_TIME/gfr.txt" > -- this is good enough > > data <- read.table("D:/rw0641/own/own/procedures/GFR_TIME/grf.txt",h=T) > > dat1 <- read.table(path1,h=T) > Error: "scan" can't open file > but doesn't work > > path1 > [1] "D:/rw0641/own/own/procedures/GFR_TIME/gfr.txt" although the path is OK > - the unpasted variant is of course ok. What happened ? > > > data > day month year crea > 1 12 3 94 140 > 2 25 9 95 144 > 3 3 7 96 167 > 4 5 12 96 174 > 5 12 3 97 187 > 6 14 6 97 188 > 7 23 9 97 201 > > Troels Ring, MD > Department of Nephrology > Aalborg Hospital > Aalborg Denmark > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._