brendensm / blogComments

0 stars 0 forks source link

blog/windows_filepaths/ #2

Open utterances-bot opened 2 weeks ago

utterances-bot commented 2 weeks ago

Brenden Smith - Dealing with Windows File Paths in R

A simple function to format complicated file paths.

https://brendenmsmith.com/blog/windows_filepaths/

pjcranney commented 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

pjcranney commented 2 weeks ago

meant Windows "\"

pjcranney commented 2 weeks ago

grrr ...... the text editor it stripped out the corrected back-slash (twice)

brendensm commented 2 weeks ago

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

pjcranney commented 2 weeks ago

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.