Description Usage Author(s) Examples
View source: R/backslashConverter.R
Since backslash is a special operator to suppress metacharacters or escape sequences, it can’t be escaped without a second backslash. This function formats every backslash into a forwardslash.
Usefull for pasting win-directories.
How it works:
(+) the function backslashConverter calls another function – readline() and saves your copied directory into the variable x.
(+) readline() converts every single \ (from your directory) into a double \. This way R won’t throw an error anymore.
(+) gsub() matches every double \ in the string x and replaces it with /.
1 2 3 | # execute blank:
backslashConverter()
# then input string.
|
Pawel Kluter
1 2 3 | > backslashConverter()
d:\
[1] "d:/"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.