[R] paste and path ?
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Mon Jun 28 00:20:43 CEST 1999
"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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list