0
votes

I am having trouble installing glmmADMB package and hoping to get some help here. I've talked to people I know who uses R but we couldn't figure this out.

Looks like the error is about a symbol in the directory. However, the ' is included as a default naming convention in Windows and I can't seem to change the folder name. I name my computer Vanessa and it automatically give the user folder name "Vanessa's PC". [It might not due to this error, since I have ran some other codes that included this symbol in the command.] Any suggestions or thoughts would be greatly appreciated.

This is the log I got:

install.packages("glmmADMB", + repos=c("http://glmmadmb.r-forge.r-project.org/repos", + getOption("repos")), + type="source") Installing package into ‘C:/Users/Vanessa's PC/Documents/R/win-library/3.4’ (as ‘lib’ is unspecified) trying URL 'http://glmmadmb.r-forge.r-project.org/repos/src/contrib/glmmADMB_0.8.3.3.tar.gz' Content type 'application/x-gzip' length 9391177 bytes (9.0 MB) downloaded 9.0 MB

  • installing source package 'glmmADMB' ... ** R ** data * moving datasets to lazyload DB ** inst ** preparing package for lazy loading Warning: package 'MASS' was built under R version 3.4.4 ** help * installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded * arch - i386 Error: unexpected symbol in "tools:::.test_load_package('glmmADMB', 'C:/Users/Vanessa's" Execution halted * arch - x64 Error: unexpected symbol in "tools:::.test_load_package('glmmADMB', 'C:/Users/Vanessa's" Execution halted ERROR: loading failed for 'i386', 'x64'
  • removing 'C:/Users/Vanessa's PC/Documents/R/win-library/3.4/glmmADMB' Warning in install.packages : running command '"C:/PROGRA~1/R/R-34~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\Vanessa's PC\Documents\R\win-library\3.4" C:\Users\VANESSA'S~1\AppData\Local\Temp\Rtmp2piXfe/downloaded_packages/glmmADMB_0.8.3.3.tar.gz' had status 1 Warning in install.packages : installation of package ‘glmmADMB’ had non-zero exit status

The downloaded source packages are in ‘C:\Users\Vanessa's PC\AppData\Local\Temp\Rtmp2piXfe\downloaded_packages’

2
(1) I'm pretty sure that your problem does indeed from the apostrophe/single quote in your path name; see stackoverflow.com/questions/47478890/… (unanswered, I made the same comment there) ...Ben Bolker
(2) the problem is in installing packages from source. If you're willing to switch to the glmmTMB package, which is available directly from CRAN (and works as well as or better than glmmADMB anyway), that would probably solve your problem ...Ben Bolker
(3) are you able to install any other packages from source?Ben Bolker
Thanks! I've only installed package that is available in CRAN before. This is the first package I try to install from source. I am installing this because I want to use the negative binomial distribution function. I used to use MASS to run negative binomial distribution, but MASS would not run - giving me no coefficient error. Can glmmTMB run negative binomial distribution?Vanessa
Yes, glmmTMB can handle negative binomial distributions. (You could also post a question that describes your problems with MASS::glm.nb; bbmle::mle2 can also be used for these problems, see stackoverflow.com/questions/40191202/…Ben Bolker

2 Answers

1
votes

Try installing the devtools package first and then installing glmmADMB directly from the development version on GitHub:

> library(devtools)
> devtools::install_github("bbolker/glmmadmb")
Downloading GitHub repo bbolker/glmmadmb@master
from URL https://api.github.com/repos/bbolker/glmmadmb/zipball/master
Installing glmmADMB
Installing 1 package: R2admb
Installing package into ‘C:/Users/User/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 
'https://cran.rstudio.com/bin/windows/contrib/3.4/R2admb_0.7.16.zip'
Content type 'application/zip' length 505317 bytes (493 KB)
downloaded 493 KB

package ‘R2admb’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\User\AppData\Local\Temp\Rtmp4WWJZp\downloaded_packages
"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" --no-site-file --no-environ 
--no-save -- no-restore --quiet CMD INSTALL  \
"C:/Users/User/AppData/Local/Temp/Rtmp4WWJZp/devtools28d0200a7e9b/bbolker- 
glmmadmb-ac75f73"  \
 --library="C:/Users/User/Documents/R/win-library/3.4" --install-tests 

* installing *source* package 'glmmADMB' ...
....

> library(glmmADMB)
Loading required package: MASS

Attaching package: ‘glmmADMB’

The following object is masked from ‘package:MASS’:

    stepAIC

The following object is masked from ‘package:stats’:

    step
0
votes

This works:

install.packages("R2admb")

install.packages("glmmADMB", 
    repos=c("http://glmmadmb.r-forge.r-project.org/repos",
            getOption("repos")),
    type="source")

library(glmmADMB)