DistanceDevelopment / distance-bugs

A place to keep bugs in Distance
http://distancesampling.org/Distance
1 stars 0 forks source link

D7R1 candidate -- install.distance.r failure on vanilla machine #166

Open lenthomas opened 8 years ago

lenthomas commented 8 years ago

Situation: Vanilla Windows 7, vanilla R (crucially: that has had no additional packages installed on it), fresh install of D7R1. Try to Run an MRDS analysis, which causes Distance to try to install packages.

Issue: error

source('C:\Program Files (x86)\Distance 7\support.r') source('C:\Program Files (x86)\Distance 7\mrds.support.r') install.distance.packages(dir='C:\Program Files (x86)\Distance 7\RPackages\') Warning in install.packages(paste(dir, "\", file.name, sep = ""), repos = repos) : 'lib = "C:/Program Files/R/R-3.3.0/library"' is not writable Error in install.packages(paste(dir, "\", file.name, sep = ""), repos = repos) : unable to install packages Calls: install.distance.packages -> install.packages Execution halted

The problem here is that R cannot write to the Program Files directory. When installing packages in R Windows interactively, at this point, the install.packages function asks the user if they wish to create a library folder in their own local directory -- but when not running interactively it just stops with an error. A workaround is simply to open R in Windows and try to install any package from CRAN using the R GUI menu Packages | Install packages; pick any package and then you get the prompt to create the local library directory. But clearly this is not a good longterm solution. Working out what's best to do is a bit tricky, and will require some thought to come up with a watertight solution. For some starting info, see the R Windows faq item "4.2 I don’t have permission to write to the R-3.3.0\library directory" and also the R help for install.packages.

erex commented 8 years ago

This is also documented on the software website at http://distancesampling.org/Distance/old-versions/d62-r-install-details.html but in the context of D6.2 rather than more generically

erex commented 8 years ago

Happy with the idea of getting more material online and less associated with software distribution. Could readily make ReadMe into markdown, but not likely before this release.