Skip to content

Write File to Shared Drive

6 messages · Stuart Jaffe, Phil Spector, Peter Langfelder +2 more

#
Stuart -
    In situations like this, I always recommend using file.choose,
so that you can navigate to the appropriate location.  For example,

write.csv(mydata,file=file.choose())

will open a file browser so you can make sure the data will get
written to exactly where you want it.

You can also use a call to file.choose() by itself to see what
path R expects to see for a particular file or directory.

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu
On Tue, 15 Feb 2011, Stuart Jaffe wrote:

            
#
On Tue, 15 Feb 2011, Stuart Jaffe wrote:
Check that you actually do have permissions to write to the directory
you want to write to, and that the directory name is correct (remember
that R always uses forward slashes in paths). Also, IIRC you need the
permissions to see (read) all parent directories of the directory you
want to write to.

Peter
#
On Tue, Feb 15, 2011 at 11:56 AM, Kevin Wright <kw.stat at gmail.com> wrote:
Interesting. I have never had to use \\ instead of / on a network
drive, with the caveat that I haven't used WIndows since maybe
R-2.6.x.

Peter
#
FYI,

you can use the following to troubleshoot what is going on:

library("R.utils");
filename <- "MyFile.csv";
path <- ... # The directory where to store
pathname <- Arguments$getWritablePathname(filename, path=path);

or if you already have the full pathname:

pathname <- Arguments$getWritablePathname(pathname);

You will get an informative error if something is not correct, e.g. it
will check the path and report which part of the path is incorrect, it
will test and report on failed write permissions etc.

/Henrik

On Tue, Feb 15, 2011 at 12:04 PM, Peter Langfelder
<peter.langfelder at gmail.com> wrote: