backslashConverter: backslashConverter()

Description Usage Author(s) Examples

View source: R/backslashConverter.R

Description

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 /.

Usage

1
2
3
# execute blank:
backslashConverter()
# then input string.

Author(s)

Pawel Kluter

Examples

1
2
3
> backslashConverter()
d:\
[1] "d:/"

kluter/LCquickVieweR documentation built on Dec. 3, 2020, 9:55 p.m.