Search code examples
rinstallation-packagerevolution-r

R Error: package ‘lme4’ required by ‘pbkrtest’ could not be found


My question is related to the post: R Error: package 'mvtnorm' required by 'multcomp' could not be found

I'm using Revolution R and I'm trying to install the pbkrtest package and I have already installed the lme4 package. However, during installation of pbkrtest, R doesn't seem to be able to find lme4. Any idea why? The same issue has popped up with a few other packages and dependencies.


Solution

  • I performed this exact operation last week without issue. I don't have admin rights, and so had to save the file to my user directory. Here is the process I used:

    Windows 7, revo R 3.2.3

    construct a directory on my desktop, open R:

    setwd(<path to my new folder>)
    download.packages(<myPackages>, destdir=getwd(), type="win.binary")
    install.packages(list.files(), repos=NULL, type="win.binary", lib=Sys.getenv("R_LIBS_USER"))
    

    Notes:
    * The reason I used download.packages() is to build an in-house repository for work.
    * A few of the (~4 of 300) packages did not download, so I had to download them manually.
    * This is my first experience with revo R, specifying type was never necessary in vanilla R, but seemed necessary here.