[R] Why "\\" instead of simple "/" to specify a file path

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Mar 22 18:51:52 CET 2010


On Mon, Mar 22, 2010 at 5:22 PM, Bogaso <bogaso.christofer at gmail.com> wrote:
>
> Hi all,
>
> I have saved my workplace in a .RData format. However if I want to open
> that, I need to use following code :
>
> load("C:\\......")
>
> Here my question is why "\\". In all the time generally we use "/" like when
> we use read.delim() function etc. Is there any possibility to have some
> consistency there? Is there any other way to re-open the .RData file?

 Single forward slash works for me (I use H: drive here, our 'home'
network folder on our system):

 > x=1
 > y=2
 > save.image(file="H:/test.rdata")
 > ls()
 [1] "x" "y"
 > rm(x)
 > rm(y)
 > load("h:/test.rdata")
 > x
 [1] 1

 How does it not work for you? Error message and R version please!

Barry



More information about the R-help mailing list