[R] Can not save files

David Winsemius dwinsemius at comcast.net
Thu Jan 1 02:52:26 CET 2015


On Dec 31, 2014, at 3:29 PM, John Sorkin wrote:

> When I try to save a file, I get "Permission denied". 

Because your OS does not allow you to save things there. Since you are specifying an absolute path, R is not using your working directory. You may want to read the help pages for:

?normalizePath
?getwd

> Can someone let me know why this happens?
> 
> 
> I am running under Windows 7, Rstudio
> 
> 
>> save(TheResults,file="c:\\data")
> Error in gzfile(file, "wb") : cannot open the connection
> In addition: Warning message:
> In gzfile(file, "wb") :
>  cannot open compressed file 'c:\data', probable reason 'Permission
> denied'
> 

Permissions are not available on your machine at the Windows equivalent of the "root". You should educate yourself about your operating system.


> 
>> save(TheResults,file="c:/data")
> Error in gzfile(file, "wb") : cannot open the connection
> In addition: Warning message:
> In gzfile(file, "wb") :
>  cannot open compressed file 'c:/data', probable reason 'Permission
> denied'
> 
> 
>> sessionInfo()
> R version 3.1.0 (2014-04-10)
> Platform: i386-w64-mingw32/i386 (32-bit)
> 
>> library(rstudio)
>> versionInfo()
> $version
> [1] ‘0.98.953’
> 
> $mode
> [1] "desktop"
> 
> 
> Thank you
> John
> 
> 
> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and
> snipped

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list