I cannot install any package after all possible methods.

install.packages("lfe")

There is a binary version available but the source version is later:
binary source needs_compilation
lfe 2.5-1998 2.8-5 TRUE

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

trying URL 'http://cran.rstudio.com/src/contrib/lfe_2.8-5.tar.gz'
Content type 'application/x-gzip' length 1117050 bytes (1.1 MB)

downloaded 1.1 MB

Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
unknown timezone 'zone/tz/2019c.1.0/zoneinfo/America/Chicago'

  • installing source package ‘lfe’ ...
    ** package ‘lfe’ successfully unpacked and MD5 sums checked
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    checking for gcc... gcc
    checking whether the C compiler works... no
    configure: error: in /private/var/folders/8n/4l2szhkn7k13f6qcpqn808t00000gn/T/Rtmp3PLLDB/R.INSTALL7bfe5f8e0390/lfe': configure: error: C compiler cannot create executables See config.log' for more details
    ERROR: configuration failed for package ‘lfe’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/lfe’
    Warning in install.packages :
    installation of package ‘lfe’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/8n/4l2szhkn7k13f6qcpqn808t00000gn/T/RtmpTSUtPY/downloaded_packages’

library(lfe)
Error in library(lfe) : there is no package called ‘lfe’

Have you tried the binary, by choosing n?

I tried choosing n. Then I got

library(dplyr)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘bindrcpp’
In addition: Warning message:
package ‘dplyr’ was built under R version 3.2.5
Error: package or namespace load failed for ‘dplyr’

See you're on MAC OS. This has been a problem all day due to a rare glitch at CRAN and it will take a bit for all the mirrors to catch-up. In the meantime,
use

install.packages(“name_of_package”, repo = "https://mac.R-project.org")

Yes, I'm Mac OS. I tried your code, but it has error.

Warning in install.packages :
unable to access index for repository https://mac.R-project.org/src/contrib
Warning in install.packages :
package ‘dplyr’ is not available (for R version 3.2.0)
Warning in install.packages :
unable to access index for repository https://mac.R-project.org/bin/macosx/mavericks/contrib/3.2

I also think it happened because of CRAN. But I just don't know how to fix it. That sucks!

My bad. Left out the training "

I just got this to work

install.packages("lme4", repo = 'https://mac.R-project.org')

The only difference between my success:

> install.packages("lme4", repo = 'https://mac.R-project.org')
Installing package into ‘/Users/rc/Library/R/3.6/library’
(as ‘lib’ is unspecified)
trying URL 'https://mac.R-project.org/bin/macosx/el-capitan/contrib/3.6/lme4_1.1-21.tgz'
Content type 'application/x-gzip' length 7809491 bytes (7.4 MB)
==================================================
downloaded 7.4 MB


The downloaded binary packages are in
	/var/folders/vw/p54wdfm95lq9wf8jkwxg_qpw0000gp/T//Rtmpk9J81c/downloaded_packages
> 

and your situation is that you are many versions behind on R.

1 Like

Following your last Post, maybe you R version is just too old?

1 Like

RStudio

Version 1.2.5033

© 2009-2019 RStudio, Inc.

"Orange Blossom" (330255dd, 2019-12-03)

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.1 Chrome/69.0.3497.128 Safari/537.36

I mean R, not RStudio. From some of your post, the error message seems to be that you have R 3.2.0?

That may be too old for some packages.

Try

sessionInfo()

Latest r version is 3.6.2

(R rather than Rstudio)

This is my R. Is it too old? What's the website I should download R?
R 3.2.0 GUI 1.65 Mavericks build (6931)

sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.14 (unknown)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] tools_3.2.0

https://cran.r-project.org/bin/macosx/

I was in my phone before...

Well, allegedly from cran, you should be able to install dplyr, which points out as an error in some of your posts, but accordingly to cran, it should be able to be installed, but maybe fromcran some dependencies like rlang will require higher version.
I am not a fan of being super-updated (actually, I am against), but your R version is quite old. You should install a newer one, but as I remember from my experience with MAC, it may be an issue

now my R is R 3.3.3 GUI 1.69 Mavericks build (7328). But the problem is not solved.

I want to copy and paste the output. But this website said I can't post a link. Anyway, it's not solved.

I updated my R to a newer version. But the problem is not solved.

If you are upgrading? why don't do it to R 3.6.X?
Maybe your SO version don't allow you?
Do you have any reason? (I didn;t upgrade mine at office for 2 years during my phd, but I didn't want to install or modify any package or anything else...)
Software management, like the one with R, is one of the reasons I have never been happy with MAcOS

now my R is : R 3.6.2 GUI 1.70 El Capitan build (7735)

install.packages("data.table")
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6/data.table_1.12.8.tgz'
Content type 'application/x-gzip' length 2133679 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

The downloaded binary packages are in
/var/folders/8n/4l2szhkn7k13f6qcpqn808t00000gn/T//Rtmp0ZSxJv/downloaded_packages

Does this mean I successfully install?