R Studio: Solution for the “\” vs “/” in paths problem

Written on 12/21/2019.
This is what wifi in a 14 hour flight is for.

Problem description
Windows shows locations like this:
“C:\Dropbox\Temp\2019\21\Example\data.csv”

But R Studio wants them to look like this
“C:/Dropbox/Temp/2019/21/Example/data.csv”

If you end up doing Find-Replace multiple times per working session, it gets old.

Readers have suggested the library(‘here’) and setting the path explicitly, but when just tinkering, I have data all over the place, so these don’t work for me.

Here you will find a low tech and a high tech solution.

High tech: SHIFT-CTRL-V
This solution involves running a script that replaces text in your clipboard from, ‘\’ to ‘/’ and then pastes the result. All in one simple stroke SHIFT-CTRL-V
(but you have to set it up)

Setup
1. Install AutoHotKey (.htm)
2. Save this script (.ahk) to your computer
3. Have the script start automatically when you reboot your PC. To do that:

a) Find the script file
b) Copy it (CTRL-C)
c) Press WINDOWS-R
c) type shell:startup
d) Paste it CTRL-V

Use:
Copy the path of interest to the clipboard
Press SHIFT-CTRL-V

So. It will be experienced like this:

CTRL-C                “c:\dropbox\temp”
SHFT-CTRL-V  “c:/ dropbox/temp”

Solution 2. Low tech: Excel
You can use the “substitute” function in Excel

Setup:
Download this spreadsheet (.xlsx)

Use:
CTRL-C the path of interest
CTRL-V into cell A3
CTRL-C from cell C3
CTRL-V into R Studio