How to install R packages that are not hosted on CRAN

Follow

Comments

3 comments

  • Avatar
    Pietro Fabbro

    Unfortunately the method does not work.

    I use a Mac and I tried to apply it both on R and on RStudio. I always get the same error message:

     

    > require(devtools)
    > install_github("braverock/blotter") # dependency
    Downloading GitHub repo braverock/blotter@master
    from URL https://api.github.com/repos/braverock/blotter/zipball/master
    Installing blotter
    '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save  \
      --no-restore --quiet CMD INSTALL  \
      '/private/var/folders/bq/7gxzb22n42gf_l3lnqypwz9r0000gn/T/RtmpwD2CUD/devtools209fe881ee7/braverock-blotter-bc75cf5'  \
      --library='/Library/Frameworks/R.framework/Versions/3.3/Resources/library' --install-tests

    * installing *source* package ‘blotter’ ...
    ** libs


    Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.


    ERROR: compilation failed for package ‘blotter’
    * removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/blotter’
    Installation failed: Command failed (1)
    > install_github("braverock/quantstrat")
    Downloading GitHub repo braverock/quantstrat@master
    from URL https://api.github.com/repos/braverock/quantstrat/zipball/master
    Installing quantstrat
    '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save  \
      --no-restore --quiet CMD INSTALL  \
      '/private/var/folders/bq/7gxzb22n42gf_l3lnqypwz9r0000gn/T/RtmpwD2CUD/devtools209f8415738/braverock-quantstrat-be01b35'  \
      --library='/Library/Frameworks/R.framework/Versions/3.3/Resources/library' --install-tests

    ERROR: dependency ‘blotter’ is not available for package ‘quantstrat’
    * removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/quantstrat’
    Installation failed: Command failed (1)

  • Avatar
    Hadrien Lacroix

    Hi Pietro,

    I'll send you a message to make sure you see our reply, but this is not an issue with the method. It's an issue with Xcode. It looks like a new version of Xcode was installed, and the updated user agreement was not accepted.

    You can run the following command to accept the user agreement:

    sudo xcodebuild -license

    and scroll down to the end and type "agree". Or, run the following command directly:

    sudo xcodebuild -license accept
  • Avatar
    Pietro Fabbro

    Thank you Hadrien,

    You solved my problem.

Please sign in to leave a comment.