Cannot install tidyverse on Mac IOS Catalina in RStudio versions 1.3.1093 or 1.4.1717 (which previously worked)

Hi all,

I had been happily using tidyverse without issue until earlier this week. I've also been having issues with ggplot2 and cowplot, but I'll focus on tidyverse here. Returning to some code which had previously worked, I attempted to load tidyverse with the library(tidyverse) command, it returned with the error " there is no package called 'tidyverse' ". When I attempted to re-install the package with install.packages("tidyverse"), RStudio would grind for a while, but ultimately come back with the error "installation of package 'tidyverse' had a non-zero exit status". In the documentation, it also came back with the same "non-zero exit status" for the supporting packages like tibble and rlang. When I tried to install it using the warning banner on the top of my script that said "packages cowplot, ggplot2, and tidyverse required but not installed", the documentation would say the packages had been installed successfully, but the packages still failed to work (again, the documentation stated that the supporting packages were not available). The full documentation for the attempted installations and subsequent errors is very long, but I can provide it upon request. Any and all help would be greatly appreciated (especially if you can provide specific code for me to try), as I am still a relative novice in R and RStudio, and still don't understand the programming language very well.

Some other things I've tried but have not worked:
-Downloading tidyverse via devtools instead of CRAN (the devtools package failed to install)
-Clearing my workspace using rm(list = ls(all = TRUE))
-Restarting RStudio
-Restarting my computer
-Uninstalling RStudio and reinstalling version 1.4.1717 (the most recent version available on my device)
-Uninstalling version 1.4.1717 and then installing 1.3.1093 (the previous version that is still available)
-individually installing the support packages like tibble, rlang, etc. (those packages failed to install)
-As a final note, I am not incapable of installing all packages; ones like mcgv and visreg are fine

Thanks again for any help you can provide!

Note: While looking through the documentation for the installation attempts, I came across this portion of it. It looks like it could be helpful, but I honestly don't know what it means or how I can check either libmxl-2.0 or the package configuration
Using PKG_CFLAGS=-I/usr/include/libxml2
Using PKG_LIBS=-lxml2 -lz -lpthread -licucore -lm
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:

  • deb: libxml2-dev (Debian, Ubuntu, etc)
  • rpm: libxml2-devel (Fedora, CentOS, RHEL)
  • csw: libxml2_dev (Solaris)
    If libxml-2.0 is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
    is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
    R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'


Just to clarify your RStudio version has no effect on your R package library so it is not related to your issue.

Package installation issues are very specific so I recommend you to address a single package at a time and post the complete error message you get when you try to install it.

From the message excerpt you are showing, it seems you are missing the libxml2 system library, you have to install it on your system (not in R), if you are on Mac, you can use homebrew to install it

brew install libxml2

As I said, you are not showing the complete error message so I can't be sure if this is your only problem.

Thank you for responding. Unfortunately that hasn't helped because I can't install homebrew either (comes back with the error "package ‘homebrew’ is not available for this version of R", which doesn't make sense because I'm running the current version of R 4.1.0, which homebrew's documentation says should work. Obviously this is a separate issue that I need to explore further, and I will look into it. Thanks again!

Homebrew is not an R package, is a package manager for macOS systems, that is why I made the clarification that you have to install this things in your system not in R.

Thanks again, I missed that. I will pursue accordingly!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.