tags:

views:

73

answers:

2

On one of my PCs, when I build any R package I get the following fatal error

* checking for file 'forecast/DESCRIPTION' ... OK
* preparing 'forecast':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* removing junk files
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building binary distribution
WARNING: some HTML links may not be found
Error in setwd(owd) : cannot change working directory
 ERROR
* installation failed

But the same packages compile fine on my other PC. I'm at a loss as to what's causing this. Has anyone else seen something similar?

Using Windows XP, R2.10.1, Rtools 2.10.

+2  A: 

Finally found the problem. I had set the variable .Library.site in the file Rprofile.site on one machine to point to a non-existent directory. It never affected R for normal use, but showed up when I tried to compile a package.

Thanks for the suggestions.

Rob Hyndman
A: 

what did you change in this direcotry? how this should look ? I changed mine to this

set a site library

.Library.site <- file.path(chartr("\", "/", R.home()), "library")

where all the libraries are located, but still cant generate the html files when building the package. Thing is... if install my package in my machine, I can open the html files, but when installing the package into another computer through the .zip file... they dont work. What's wrong?

Iago
You will need 2 back-slashes: .Library.site <- file.path(chartr("\\", "/", R.home()), "library")
Rob Hyndman