Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install.distance.packages failure in support.r #155

Open
dfifield opened this issue Oct 13, 2015 · 2 comments
Open

install.distance.packages failure in support.r #155

dfifield opened this issue Oct 13, 2015 · 2 comments

Comments

@dfifield
Copy link

I was attempting to use the mrds engine through the Distance 6.2R1 user interface. This was a "fresh" machine belonging to a friend with no mrds R package installed.

I got the following error message in the log:

source('C:\Program Files (x86)\Distance 6\support.r')
source('C:\Program Files (x86)\Distance 6\mrds.support.r')
install.distance.packages(dir='C:\Program Files (x86)\Distance 6\RPackages')
Attempting to install: mrds
Installing package into 'C:/Users/fifieldd/Documents/R/win-library/3.2'
(as 'lib' is unspecified)
Error in install.packages(paste(dir, "", file.name, sep = ""), repos = repos, :
type == "both" cannot be used with 'repos = NULL'
Calls: install.distance.packages -> install.packages
Execution halted

I tracked it down to line 67 in support.r:

install.packages(paste(dir,"",file.name,sep=""),repos=repos)

Unfortunately, the R installation on this machine has getOption("pkgType") == "both", which causes install.packages to choke.

My solution was to change line 67 in support.r to:
install.packages(paste(dir,"",file.name,sep=""),repos=repos, type = "win.binary")

However, I realize this is a wholly Windows-centric fix!

Cheers,

Dave

Dave Fifield
dave.fifield@ec.gc.ca

@dill
Copy link
Contributor

dill commented Oct 14, 2015

Hi Dave, have you tried installing with R 3.1? This version of Distance is only tested with R 3.1 and I believe this problem might well be down to a change in R. On Windows one can have multiple versions of R installed (I believe) so there shouldn't be an issue in having both 3.1 and 3.2 on the machine.

Please do post again here if it works or not. Thanks!

@dfifield
Copy link
Author

Yes, you're right, it does work in 3.1. The difference is that in 3.1 the default value for option "pkgType" is "win.binary" whereas in 3.2 it is "both" and as mentioned my original post, install.packages chokes when repos == NULL, type == "both". You will no doubt run into this when you test Distance under R 3.2.

Cheers,
Dave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants