[R] Can not save files

jwd jwd at surewest.net
Fri Jan 2 09:00:38 CET 2015


On Wed, 31 Dec 2014 18:29:05 -0500
"John Sorkin" <JSorkin at grecc.umaryland.edu> wrote:

> When I try to save a file, I get "Permission denied". 
> Can someone let me know why this happens?
> 
> 
> I am running under Windows 7, Rstudio
> 
> 
> > save(TheResults,file="c:\\data")

You are explicitly attempting to place a file named "data" in your root
directory.  You lack privileges to write into the root directory,
which action is the source of the "permission denied" message. Good
practice is to use a directory in your user-space such as a
subdirectory of Documents as indicated by Mr. Newmiller. Ideally you
should use getwd() and setwd() locate and set the directory where your
data and any saved files are placed.  If you are using are RStudio, it
is relatively simple do this under the "Session/Set Working Directory"
menu choices.  

JWDougherty



More information about the R-help mailing list