Error downloading dplyr

** When I do this it runs and when I try

Library(dplyr) 
Error in library("dplyr") : there is no package called ‘dplyr’

---------------------------
install.packages("dplyr")
also installing the dependencies ‘fansi’, ‘pillar’, ‘glue’, ‘Rcpp’, ‘rlang’, ‘tibble’, ‘tidyselect’


  There are binary versions available but the source versions are later:
            binary  source needs_compilation
pillar       1.0.1   1.3.1             FALSE
glue         1.2.0   1.3.1              TRUE
Rcpp       0.12.14   1.0.0              TRUE
rlang        0.1.6   0.3.1              TRUE
tibble       1.3.4   2.0.1              TRUE
tidyselect   0.2.3   0.2.5              TRUE
dplyr        0.7.4 0.8.0.1              TRUE

Do you want to install from sources the packages which need compilation?
y/n: y
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘fansi’
Do you want to attempt to install these from sources?
y/n: y
installing the source packages ‘fansi’, ‘pillar’, ‘glue’, ‘Rcpp’, ‘rlang’, ‘tibble’, ‘tidyselect’, ‘dplyr’

trying URL 'https://cran.rstudio.com/src/contrib/fansi_0.4.0.tar.gz'
Content type 'application/x-gzip' length 266123 bytes (259 KB)
==================================================
downloaded 259 KB

trying URL 'https://cran.rstudio.com/src/contrib/pillar_1.3.1.tar.gz'
Content type 'application/x-gzip' length 103972 bytes (101 KB)
==================================================
downloaded 101 KB

trying URL 'https://cran.rstudio.com/src/contrib/glue_1.3.1.tar.gz'
Content type 'application/x-gzip' length 122950 bytes (120 KB)
==================================================
downloaded 120 KB

trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_1.0.0.tar.gz'
Content type 'application/x-gzip' length 3635277 bytes (3.5 MB)
==================================================
downloaded 3.5 MB

trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.3.1.tar.gz'
Content type 'application/x-gzip' length 857682 bytes (837 KB)
==================================================
downloaded 837 KB

trying URL 'https://cran.rstudio.com/src/contrib/tibble_2.0.1.tar.gz'
Content type 'application/x-gzip' length 729338 bytes (712 KB)
==================================================
downloaded 712 KB

trying URL 'https://cran.rstudio.com/src/contrib/tidyselect_0.2.5.tar.gz'
Content type 'application/x-gzip' length 21883 bytes (21 KB)
==================================================
downloaded 21 KB

trying URL 'https://cran.rstudio.com/src/contrib/dplyr_0.8.0.1.tar.gz'
Content type 'application/x-gzip' length 1075146 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
* installing *source* package ‘fansi’ ...
** package ‘fansi’ 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 ‘fansi’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/fansi’
Warning in install.packages :
  installation of package ‘fansi’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
* installing *source* package ‘glue’ ...
** package ‘glue’ 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 ‘glue’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/glue’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/glue’
Warning in install.packages :
  installation of package ‘glue’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ 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 ‘Rcpp’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp’
Warning in install.packages :
  installation of package ‘Rcpp’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
* installing *source* package ‘rlang’ ...
** package ‘rlang’ 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 ‘rlang’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rlang’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/rlang’
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
ERROR: dependency ‘fansi’ is not available for package ‘pillar’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/pillar’
Warning in install.packages :
  installation of package ‘pillar’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
* installing *source* package ‘tidyselect’ ...
** package ‘tidyselect’ 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 ‘tidyselect’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/tidyselect’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/tidyselect’
Warning in install.packages :
  installation of package ‘tidyselect’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
ERROR: dependencies ‘fansi’, ‘pillar’ are not available for package ‘tibble’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/tibble’
Warning in install.packages :
  installation of package ‘tibble’ had non-zero exit status
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018i.1.0/zoneinfo/America/Los_Angeles'
ERROR: dependency ‘tibble’ is not available for package ‘dplyr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/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/yq/1q1qc8g952vd68jyw6z1jxyr0000gn/T/RtmpWM2uv0/downloaded_packages’

** When I do this it runs and when I try

Library(dplyr) 
Error in library("dplyr") : there is no package called ‘dplyr’

Try updating xcode in your OS

xcode-select --install
1 Like

Feeling really dumb - but I'm not sure how to do that?
I'm on a mac... Running RStudio
Version 1.1.463 – © 2009-2018 RStudio, Inc.

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko)

I definitely remember being there!

There are a number of step by step guides and videos on how to do this.
For example,

I still forget it and stare into space for a half hour every time it happens. :slight_smile:

Thank you! You are all so kind and helpful - been staring into space for well over an hour! :wink:

About every other Mac OS update seems to break and not attempt to refigure things relative to C++ toolchains. Mojave was especially brutal. Not criticizing the Mac here (I love macs), just saying.

xcode is almost always the fix.

1 Like

I'm still getting the same error :frowning:

The downloaded source packages are in
‘/private/var/folders/yq/1q1qc8g952vd68jyw6z1jxyr0000gn/T/RtmpmWRxnG/downloaded_packages’

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

Has this package been discontinued? Does anyone know what I can replace it with if so?
Sorry to be such a novice!
(also - anyone know of a good tutor or course? I'm desperate!)

Have you installed ggplot2 since you installed xcode?

I have tried and get the error showing :frowning:
Do you want to install from sources the packages which need compilation?
y/n: y
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘fansi’
Do you want to attempt to install these from sources?
y/n: y

Then the same error...

When you say "the same error" which do you mean? If you could paste the output of the installation, as you did in the original post, it would be helpful.

Also, I understand that this might not be possible if you're in a corporate environment, but have you considered updating your version of R (not RStudio)? It looks like you're using 3.3.*, and the latest version is 3.5.3.

Thank you, Mara. I will try and update it now.
I also keep getting the error:

Warning in install.packages :
package ‘ggplot’ is not available (for R version 3.3.2)

I'm so confused - I just ran this code a few days ago and it was all fine :frowning:

I am still not able to run plyr or dplyr or ggplot (these are pretty much the only packages I know how to use!) see below... Do I need to do something about the last line... where it says where the packages are?

R version 3.5.3 (2019-03-11) -- "Great Truth"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Workspace loaded from ~/.RData]

> Help > Check for Updates
Error: unexpected 'for' in "Help > Check for"
> help("Check for Updates")
No documentation for ‘Check for Updates’ in specified packages and libraries:
you could try ‘??Check for Updates’
> '??Check for Updates'
[1] "??Check for Updates"
> rm(list = ls())
> source("~/Box Sync/FITriMS Study/R-FITriMS/Helpers.R")
Error: package or namespace load failed for ‘plyr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘Rcpp’
> try(detach("package:dplyr"), silent = TRUE)
> library(plyr)
Error: package or namespace load failed for ‘plyr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘Rcpp’
> install.packages("plyr")
also installing the dependency ‘Rcpp’

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/Rcpp_1.0.0.tgz'
Content type 'application/x-gzip' length 4535632 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/plyr_1.8.4.tgz'
Content type 'application/x-gzip' length 946407 bytes (924 KB)
==================================================
downloaded 924 KB


The downloaded binary packages are in
	/var/folders/yq/1q1qc8g952vd68jyw6z1jxyr0000gn/T//RtmprLSpm4/downloaded_packages

You are showing everything but the relevant error message, what is the whole output of running this command?

install.packages("Rcpp")

install.packages("Rcpp")
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/Rcpp_1.0.0.tgz'
Content type 'application/x-gzip' length 4535632 bytes (4.3 MB)

downloaded 4.3 MB

The downloaded binary packages are in
/var/folders/yq/1q1qc8g952vd68jyw6z1jxyr0000gn/T//RtmpUFmAHl/downloaded_packages

And then I also get this:

library(reshape2)
Error: package or namespace load failed for ‘reshape2’ in library.dynam(lib, package, package.lib):
shared object ‘stringi.so’ not found
find.package("reshape2")
[1] "/Library/Frameworks/R.framework/Versions/3.5/Resources/library/reshape2"
library("reshape2")
Error: package or namespace load failed for ‘reshape2’ in library.dynam(lib, package, package.lib):
shared object ‘stringi.so’ not found
library("reshape2", lib.loc="/Library/Frameworks/R.framework/Versions/3.5/Resources/library")
Error: package or namespace load failed for ‘reshape2’ in library.dynam(lib, package, package.lib):
shared object ‘stringi.so’ not found

Im so confused as to why my RStudio suddenly doesn't work?

Have you recently updated to R >= 3.5 from R <= 3.4.X?
If that is the case then you will need to reinstall all your packages under the new R version.

I did update - and I am trying to reinstall, but I get the error:

install.packages("reshape2")
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/reshape2_1.4.3.tgz'
Content type 'application/x-gzip' length 286207 bytes (279 KB)
==================================================
downloaded 279 KB

The downloaded binary packages are in
/var/folders/yq/1q1qc8g952vd68jyw6z1jxyr0000gn/T//RtmpUFmAHl/downloaded_packages

library("reshape2")
Error: package or namespace load failed for ‘reshape2’ in library.dynam(lib, package, package.lib):
shared object ‘stringi.so’ not found

This has never happened to me before. Is it due to the update? am I doing something fundamentally wrong?

Yes, it is, your problem is that you are trying to install over the old packages and that is causing conflicts, you need to start all over by un install R deleting the library folder and making a new clean installation.

1 Like