ecology
ecology

Reputation: 663

Errors installing "dplyr" in r

Question: unable to install dplyr in R... code below. Anyone offer any solutions? I'm on a mac osx sierra and R Version 1.0.136

> install.packages("dplyr")

  There is a binary version available but the source version
  is later:
      binary source needs_compilation
dplyr  0.5.0  0.7.0              TRUE

Do you want to install from sources the package which needs compilation?
y/n: 
y
installing the source package ‘dplyr’

trying URL 'https://cran.rstudio.com/src/contrib/dplyr_0.7.0.tar.gz'
Content type 'application/x-gzip' length 690938 bytes (674 KB)
==================================================
downloaded 674 KB

* installing *source* package ‘dplyr’ ...
** package ‘dplyr’ successfully unpacked and MD5 sums checked
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘dplyr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/dplyr’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/dplyr’
Warning in install.packages :
  installation of package ‘dplyr’ had non-zero exit status

The downloaded source packages are in


‘/private/var/folders/ll/6vx1dr1n5bb9zwbv1z9v53z00000gn/T/RtmpitMpQn/downloaded_packages’
> library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘DBI’

Not sure why this isn't working! Tried to download manually and it didn't work either (similar/same warnings/errors)

Upvotes: 4

Views: 13629

Answers (1)

zeehio
zeehio

Reputation: 4138

A new dplyr version was accepted into CRAN yesterday. Usually CRAN provides packages for both Windows and OSX in binary form, but it takes up to 48 hours for CRAN to provide the compiled packages.

When you try to install a package in that time window, R asks you to either install the previous binary version or the new version from source. If you decide to install the version from source you will need to have a c++ compiler.

The easiest thing for you to do is to either install the previous binary package or wait until the latest version gets compiled at CRAN.

Checkout https://cran.r-project.org/web/packages/dplyr/index.html to see if the binaries for your OS are already available.

Update: It seems there are some issues with the latest dplyr version, and the OSX compilation seems to fail. More info here: https://cran.r-project.org/web/checks/check_results_dplyr.html. I would rather stay with 0.5.0 until those issues are ironed out.

Upvotes: 6

Related Questions