swirl - cannot download readr

I can't download readr when following swirl instruction. I have downloaded x code app, x code line tool, just everything about xcode but still it doesn't work...

| Trying to install package ‘readr’ now...
Warning in install.packages :
unable to access index for repository https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6:
cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/PACKAGES'
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘readr’
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package ‘readr’

Warning in install.packages :
installation of package ‘readr’ had non-zero exit status

| Could not install package ‘readr’!
| | 0%Error in seq.default(0, 1, length.out = nrow(e$les)) :
argument 'length.out' must be of length 1

If you don't need the latest versions, answer "no" to this question and you would get the binary version which is a little older but easier to install.

thanks for your reply. I did, but still not working. I even updated my os to refresh the xcode.

Do you want to attempt to install these from sources? (Yes/no/cancel) no

| Could not install package ‘readr’!
| | 0%Error in seq.default(0, 1, length.out = nrow(e$les)) :
argument 'length.out' must be of length 1

| Leaving swirl now. Type swirl() to resume.

There seems to be an issue with CRAN repositories for macOS not all of them have binary installers for macOS so try changing your CRAN repository, I'm sorry I can't tell you exactly which one since I'm not a macOS user.

1 Like

today I tried to install again and suddenly it worked!!! Below are the codes I tried:

installed.packages("readr")
Package LibPath Version Priority Depends Imports LinkingTo Suggests Enhances License License_is_FOSS License_restricts_use
OS_type Archs MD5sum NeedsCompilation Built
library(readr)
Error in library(readr) : there is no package called ‘readr’
install.packages("readr")
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/readr_1.3.1.tgz'
Content type 'application/x-gzip' length 792657 bytes (774 KB)
==================================================
downloaded 774 KB

The downloaded binary packages are in
/var/folders/6q/jpk5dpt14_q1knkrtm5tysnr0000gn/T//Rtmp302MXN/downloaded_packages

library(readr)

library("readr")