Description Usage Arguments Details Value Author(s) See Also Examples
scan a character string with backslash as the quote character and return it with backslashs replaced by forward slash.
NOTE: 'c:\User' cannot be assigned to a character variable, because '\U' must be followed by a hexidecimal number, and 's' is not a legal hexidecimal digit. Therefore, we read the character string of interest using scan rather than assigning it to a function argument.
1 | back2ForwardSlash(nmax=1, what=character(), sep='\n', ...)
|
nmax, what, sep, ... |
arguments passed to |
It's not easy to turn a back slash into a forward slash, because R
interprets the back slash as an escape character.
back2ForwardSlash
tells R to read the next nmax
lines,
replacing '\' with '/'.
character vector with backslashes replaced by forward slashes.
Spencer Graves with help from Richard Cotton and Garrett See
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | (x <- back2ForwardSlash())
#c:\users\
#NOTE: The "#" in this example is not needed.
# It is included here to suppress a spurious warning
# in the automated testing of the package via "R CMD check".
all.equal(x, '#c:/users/')
(x2. <- back2ForwardSlash(2))
#c:\u\a b\n o
#d:\pqr\
all.equal(x2., c('#c:/u/a b/n o', '#d:/pqr/'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.