[R] some related problems
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Fri Nov 12 16:31:17 CET 1999
"Jens Oehlschlägel-Akiyoshi" <jens.oehlschlaegel-akiyoshi at mdfactory.de> writes:
> How can I make these commands working during .RProfile execution?
> Moreover: how can I exchange single Backslashes to slashes in R?
>
> I tried:
>
> > gsub("[\\]", "/", "c:\temp")
> [1] "c: emp"
> > gsub("[\\]", "/", "c:\\temp")
> [1] "c:/temp"
The 2nd line *is* the way to change a single backslash.
Hint:
> nchar("c:\temp")
[1] 6
> substr("c:\temp",3,3)
[1] "\t"
> nchar("c:\\temp")
[1] 7
> substr("c:\\temp",3,3)
[1] "\\"
> nchar("\\")
[1] 1
> cat("\\")
\>
--
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