Tidyverse failing to load

R version 4.0.2,

I'm attempting to install tidyverse, but I've been running into a series of issues. At first I attempted to fix by installing "Rccp", as the prompt stated that it used invalid namespace. That did not seem to work, but I noticed that now it stated that it needed Rtools to download effectively. I've installed that successfully, but I'm now getting this error:

library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in inDL(x, as.logical(local), as.logical(now), ...):
 ICU init failed: U_INVALID_FORMAT_ERROR

I've looked around online but I can't find someone with an error like this one. I've also tried uninstalling and reinstalling both Rstudio and R itself, but no luck there. I've downloaded tidyverse fine on my laptop before, it's only behaving strangely on my desktop.

I'm running windows 10, and I've also noticed that it's trying to download packages into my OneDrive folder - I'm not sure if this would cause an error or not.

I am running Windows 10 too, and this is what I've done:

install.packages("tidyverse")
library(tidyverse)

There is a possibility that it is because it's trying to go into a OneDrive folder, check your working directory:

setwd()

I also got the Rtools warning but I did not install that, and my packages are working.
Perhaps that is the issue, that Rtools may have a conflict instead of actually helping. You can also try to run:

tidyverse::tidyverse_packages()
and this should bring up all of the packages available within the library. See the code and output below:

install.packages("tidyverse")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Robin/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependencies ‘highr’, ‘xfun’, ‘knitr’, ‘tinytex’, ‘DBI’, ‘blob’, ‘fs’, ‘rmarkdown’, ‘whisker’, ‘dbplyr’, ‘modelr’, ‘reprex’

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/highr_0.8.zip'
Content type 'application/zip' length 48706 bytes (47 KB)
downloaded 47 KB

package ‘highr’ successfully unpacked and MD5 sums checked
package ‘xfun’ successfully unpacked and MD5 sums checked
package ‘knitr’ successfully unpacked and MD5 sums checked
package ‘tinytex’ successfully unpacked and MD5 sums checked
package ‘DBI’ successfully unpacked and MD5 sums checked
package ‘blob’ successfully unpacked and MD5 sums checked
package ‘fs’ successfully unpacked and MD5 sums checked
package ‘rmarkdown’ successfully unpacked and MD5 sums checked
package ‘whisker’ successfully unpacked and MD5 sums checked
package ‘dbplyr’ successfully unpacked and MD5 sums checked
package ‘modelr’ successfully unpacked and MD5 sums checked
package ‘reprex’ successfully unpacked and MD5 sums checked
package ‘tidyverse’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Robin\AppData\Local\Temp\Rtmp2fq3qd\downloaded_packages

library(tidyverse)
-- Attaching packages --------------------------------------- tidyverse 1.3.0 --
v readr 1.3.1 v stringr 1.4.0
v purrr 0.3.4 v forcats 0.5.0
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x lubridate::as.difftime() masks base::as.difftime()
x lubridate::date() masks base::date()
x jrvFinance::duration() masks lubridate::duration()
x magrittr::extract() masks tidyr::extract()
x dplyr::filter() masks plotly::filter(), stats::filter()
x dplyr::first() masks xts::first()
x lubridate::intersect() masks base::intersect()
x dplyr::lag() masks stats::lag()
x dplyr::last() masks xts::last()
x purrr::set_names() masks magrittr::set_names()
x lubridate::setdiff() masks base::setdiff()
x lubridate::union() masks base::union()
tidyverse::tidyverse_packages()
[1] "broom" "cli" "crayon" "dbplyr" "dplyr" "forcats" "ggplot2" "haven" "hms" "httr" "jsonlite"
[12] "lubridate" "magrittr" "modelr" "pillar" "purrr" "readr" "readxl" "reprex" "rlang" "rstudioapi" "rvest"
[23] "stringr" "tibble" "tidyr" "xml2" "tidyverse"

Thank you for the help, I think it was because I did not have a default user library (which was why it was installing to OneDrive automatically). This was solved by creating a folder "C:R\Library". Then I went into the windows control panel, User Accounts, and clicked on the option "Change my environment variables". Then under user variables I clicked "New...", typed

R_LIBS_USER

for the name, then for the value I typed the path to the folder I created earlier. Tidyverse installed and loaded correctly after this.

Glad that's all solved :slight_smile:

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