Open utterances-bot opened 2 weeks ago
This looked really handy so I tried it, and it worked well. To understand what it did I tried, without running your function, copying from Windows Explorer and pasting into RStudio . To my surprise, it pasted with "/" rather than the Windows "\". Maybe this is built into RStudio, but I was unaware of it. One way or the other, I ended up smarter and happier. Thanks
meant Windows "\"
grrr ...... the text editor it stripped out the corrected back-slash (twice)
@pjcranney I'm really glad you found this helpful! It's interesting that you don't run into this same problem. I wonder what the difference is. Are you specifically clicking "copy as path" from the explorer on Windows? If it is an RStudio feature I wonder if this is something you have to enable.
From the explorer on Windows I am doing CtrlC as if to copy the file. In RStudio I am doing CtrlV and I get foward-slashes (and a big smile!). If I CrtV into MSWord I get a completely different outcome.
Brenden Smith - Dealing with Windows File Paths in R
A simple function to format complicated file paths.
https://brendenmsmith.com/blog/windows_filepaths/