I often use windows to copy and paste file paths into R scripts, which results in something like the following:
file = 'C:\this\is\a\test.tif'
However, this results in an error and I have to manually switch the path seperators from \
to /
>file = 'C:\this\is\a\test.tif'
Error: '\i' is an unrecognized escape in character string starting "'C:\this\i"
If I were using Python, I would simply use the following to format the path correctly:
file = r'C:\this\is\a\test.tif'
Is there a similar R method to Python's raw string r''
method to quickly format paths?