4

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)

7
  • 1
    Are you sure that's your R version? R 1.2 came out in 2001. The current version is 3.4 Commented Jun 11, 2017 at 22:08
  • 1
    Also, when you see "there is no package called ‘DBI’" in an error, is it safe to assume you tried install.packages("DBI"), and it still doesn't work? Commented Jun 11, 2017 at 22:09
  • 2
    Installed DBI, then dplyr worked. Tried to install ggplot 2 NOW IT WONT LET ME INSTALL GGPLOT2... what is happening? Commented Jun 11, 2017 at 22:21
  • 2
    Also, that was my rstudio version ... whoops Commented Jun 11, 2017 at 22:23
  • 2
    We can't tell without more information. Since you've solved the problem stated here, you should probably ask a new question (or at worst, give us details in the comments ... what error message are you getting?) Commented Jun 11, 2017 at 22:33

1 Answer 1

6

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.