Joanna Papakonstantinou
2013-Feb-20 16:54 UTC
[R] Error in setwd(outDir) : cannot change working directory
I installed R on my Windows laptop in C:\Program Files\R\R-2.15.2 and am able to open RGUI (640bit), see packages and run commands. However, when I test the installation and run the basic tests and all the tests on the standard and recommended packages i.e.: library("tools") testInstalledBasic("both") testInstalledPackages("base", errorsAreFatal = FALSE) testInstalledPackages("recommended", errorsAreFatal = FALSE) I am getting errors such as: > testInstalledPackages("base",errorsAreFatal=FALSE) Error in setwd(outDir) : cannot change working directory my working driectory is:>getwd()[1] "C:/Users/jpapa/Documents" In which I see R folder as well as the .rData from my last session. what does the wd have to do with the output directory? Do I need to create an output directory? DO I need to setwd(outDir)? do i need to change the wd (for example to the Pogram Files directory where R is installed or to another directory I need to create? if so, how do I do this? i also noticed that i have packages in \library ‘C:/Users/jpapa/Documents/R/win-library/2.15’ and in library ‘C:/Program Files/R/R-2.15.2/library’. Do all packages need to be in one place? If so, should they be in my Documents or in Program Files? Thank you for your help. ****************************************************************** *Joanna Papakonstantinou, Ph.D.* [[alternative HTML version deleted]]
Gabor Grothendieck
2013-Feb-20 17:33 UTC
[R] Error in setwd(outDir) : cannot change working directory
On Wed, Feb 20, 2013 at 11:54 AM, Joanna Papakonstantinou <joanna.papa at gmail.com> wrote:> I installed R on my Windows laptop in C:\Program Files\R\R-2.15.2 > > and am able to open RGUI (640bit), see packages and run commands. However, > when I test the installation and run the basic tests and all the tests on > the standard and recommended packages i.e.: > > library("tools") > > testInstalledBasic("both") > > testInstalledPackages("base", errorsAreFatal = FALSE) > > testInstalledPackages("recommended", errorsAreFatal = FALSE) > > > > I am getting errors such as: > > > testInstalledPackages("base",errorsAreFatal=FALSE) > > Error in setwd(outDir) : cannot change working directory > > > > my working driectory is: > >>getwd() > > [1] "C:/Users/jpapa/Documents" > In which I see R folder as well as the .rData from my last session. > > what does the wd have to do with the output directory? Do I need to create > an output directory? DO I need to setwd(outDir)? > > do i need to change the wd (for example to the Pogram Files directory where > R is installed or to another directory I need to create? if so, how do I do > this? > > > > > > i also noticed that i have packages in > > \library ?C:/Users/jpapa/Documents/R/win-library/2.15? > > and in library ?C:/Program Files/R/R-2.15.2/library?. > > Do all packages need to be in one place? If so, should they be in my > Documents or in Program Files?Its likely trying to write in the C:\Program Files tree but lacks permission. Run R with Administrator permissions or re-install R elsewhere, e.g. C:\R -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
Gabor Grothendieck
2013-Feb-20 17:52 UTC
[R] Error in setwd(outDir) : cannot change working directory
On Wed, Feb 20, 2013 at 12:33 PM, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:> On Wed, Feb 20, 2013 at 11:54 AM, Joanna Papakonstantinou > <joanna.papa at gmail.com> wrote: >> I installed R on my Windows laptop in C:\Program Files\R\R-2.15.2 >> >> and am able to open RGUI (640bit), see packages and run commands. However, >> when I test the installation and run the basic tests and all the tests on >> the standard and recommended packages i.e.: >> >> library("tools") >> >> testInstalledBasic("both") >> >> testInstalledPackages("base", errorsAreFatal = FALSE) >> >> testInstalledPackages("recommended", errorsAreFatal = FALSE) >> >> >> >> I am getting errors such as: >> >> > testInstalledPackages("base",errorsAreFatal=FALSE) >> >> Error in setwd(outDir) : cannot change working directory >> >> >> >> my working driectory is: >> >>>getwd() >> >> [1] "C:/Users/jpapa/Documents" >> In which I see R folder as well as the .rData from my last session. >> >> what does the wd have to do with the output directory? Do I need to create >> an output directory? DO I need to setwd(outDir)? >> >> do i need to change the wd (for example to the Pogram Files directory where >> R is installed or to another directory I need to create? if so, how do I do >> this? >> >> >> >> >> >> i also noticed that i have packages in >> >> \library ?C:/Users/jpapa/Documents/R/win-library/2.15? >> >> and in library ?C:/Program Files/R/R-2.15.2/library?. >> >> Do all packages need to be in one place? If so, should they be in my >> Documents or in Program Files? > > Its likely trying to write in the C:\Program Files tree but lacks > permission. Run R with Administrator permissions or re-install R > elsewhere, e.g. C:\RAlso regarding your questions your setup is the standard desirable setup (with a separate user library) and R in the \Program Files tree so there seems nothing wrong with your library setup or how R itself has been set up on your system. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
S Ellison
2013-Feb-20 18:20 UTC
[R] Error in setwd(outDir) : cannot change working directory
> I am getting errors such as: > > testInstalledPackages("base",errorsAreFatal=FALSE) > > Error in setwd(outDir) : cannot change working directoryEr, the first parameter in testInstalledPackages() is the output directory name, not the package name supplied in scope. You probably don;t have a writeable directory called "base" Try testInstalledPackages(scope="base",errorsAreFatal=FALSE) S Ellison ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}
Gabor Grothendieck
2013-Feb-20 19:29 UTC
[R] Error in setwd(outDir) : cannot change working directory
On Wed, Feb 20, 2013 at 1:08 PM, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:> On Wed, Feb 20, 2013 at 1:01 PM, Joanna Papakonstantinou > <joanna.papa at gmail.com> wrote: >> I am running as administrator. >> >> Again, the first 2 tests worked but the 3rd is still giving me an error: >>> testInstalledBasic("basic") >> running strict specific tests >> running code in ?eval-etc.R? >> comparing ?eval-etc.Rout? to ?eval-etc.Rout.save? ...[1] 1 >>> testInstalledBasic("both") >> running strict specific tests >> running code in ?eval-etc.R? >> comparing ?eval-etc.Rout? to ?eval-etc.Rout.save? ...[1] 1 >> >>> testInstalledPackages("base",errorsAreFatal=FALSE) >> Error in setwd(outDir) : cannot change working directory >> > > I also got errors. There may be something wrong with the tests themselves.Just a clarification. The errors I was referring to was the fact that both you and I got a result of 1 for the first too. That indicates that the test and target differed. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com