Total Beginner stuck on installing tidyverse (error code +++)

Hello friends! I'm a total R beginner and learning to analyze data from clinical trials. I've fallen at the first hurdle: trying to install tidyverse. I can't seem to interpret the error code and figure out what I'm doing wrong. Any guidance much appreciated:

> install.packages("tidyverse")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/tidyverse_1.3.0.tgz'
Content type 'application/x-gzip' length 433049 bytes (422 KB)
==================================================
downloaded 422 KB


The downloaded binary packages are in
	/var/folders/gh/c2_0_qzs7_78hwwny61z9z880000gn/T//RtmpNudTjO/downloaded_packages
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so, 6): Symbol not found: _EXTPTR_PTR
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so
  Expected in: /Library/Frameworks/R.framework/Resources/lib/libR.dylib
 in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so
In addition: Warning message:
package ‘tidyverse’ was built under R version 4.0.2 
> remove.packages("tidyverse")
Removing package from ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library’
(as ‘lib’ is unspecified)
> library(tidyverse)
Error in library(tidyverse) : there is no package called ‘tidyverse’
> install.packages("tidyverse"
+                 )
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/tidyverse_1.3.0.tgz'
Content type 'application/x-gzip' length 433049 bytes (422 KB)
==================================================
downloaded 422 KB


The downloaded binary packages are in
	/var/folders/gh/c2_0_qzs7_78hwwny61z9z880000gn/T//RtmpNudTjO/downloaded_packages

Try to install packages the Rcpp binary

Not sure if this is the problem, but are you running R as administrator/superuser?

I don't think so... I'm just using R Studio on my personal macbook air. And thanks also for your reply!

I'm recommending you try

install.packages(pkgs = "Rcpp",type="binary")

please write back if there are further issues.

Thanks very much Nir. I ran that line of code first and then tried to download and load tidyverse but still no joy (screenshot of code below). Do you have any further suggestions? Again, really appreciate all your help.

Apologies not sure if I did direct reply correctly, have posted below. Thank you!

It seems to be an issue with the CRAN version of Rcpp for MacOS systems, can you try installing this way?

install.packages("Rcpp", repos="https://rcppcore.github.io/drat")

This is the GitHub issue for reference

Thanks to you and everyone for all your help. I did the rather old fashioned thing of uninstalling R and R Studio, and upon re-install I'm not able to load tidyverse etc without issue. Thanks again!

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.

Forgive me, I'm such a noob that I don't actually know what that means. Is there a line of code I can run? And thanks for your response!