0

I currently run a report on my computer that accesses a file from a folder on a shared drive. On my device this is the R: drive so it is super basic to load with read.csv() using

read.csv(file="R:/Shared Factory/Allocation/Applied Analytics/Projects/Top 30 Report/initiative.csv")

However, now this R script is being moved to the server so this alias R: does not apply. I tried changing the filepath to match the actual full server name, \\nas-06 as in read.csv(file="\\\\nas-06\\Shared Factory\\Allocation\\Applied Analytics\\Projects\\Top 30 Report\\initiative.csv")

or whq_factory with read.csv(file="\\\\whq_factory\\Shared Factory\\Allocation\\Applied Analytics\\Projects\\Top 30 Report\\initiative.csv")

but both say the connection cannot be opened.

How do I correctly open this connection using the actual server filepath and not an alias? I'm open for a creative way to include a working example for everyone if anyone has an idea.

CMontague
  • 1
  • 2
  • You might have to substitute the backslashes "\" with forward "/" slashes. – hugot Sep 02 '15 at 15:37
  • Is your server also a windows machine? – darwin Sep 02 '15 at 15:56
  • @hugo I've tried that, but I'm guessing its going to be something simple like that. – CMontague Sep 02 '15 at 19:46
  • @darwin Yeah its a windows. – CMontague Sep 02 '15 at 19:48
  • So, I am a unix/linux user, but you should be able to ask how to access the drive or if you can see it in the directory, then right click to get the path or drag and drop the file into the R session. I think your "\" are right for a windows machine, but the path inside the server may change depending on how it is set up. – darwin Sep 02 '15 at 21:01
  • @CMontague I'm sorry, I'm also on a linux machine, but perhaps you need to use two backslashes for each backslash, that is: `read.csv(file="\\\\\\whq_factory\\\Shared Factory\\\Allocation\\\Applied Analytics\\\Projects\\\Top 30 Report\\initiative.csv")`. See explanation in [this other post](http://stackoverflow.com/questions/11806501/backslash-in-r-string) – hugot Sep 03 '15 at 08:18

0 Answers0