Issue loading ggpubr when using renv with project

I am having trouble loading ggpubr when using renv with my project. I have no issues when trying to load the package outside of a renv. My other packages have loaded as well. I had no issues when I initially created the project. I also tried to use the reprex() function to aid in this question, but returned the error of:

Error: This reprex appears to crash R

Here is my session info:

R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Here is the code I am having issues with.

install.packages(c("skimr", "dplyr","ggplot2","ggpubr"))
library(skimr)
library(dplyr)
library(ggplot2)
library(ggpubr)

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

I tried a number of things, with no luck:

  • Tried creating a new Rproject with renv, and installing/loading ggpubr
  • Forced renv to use the same download method as R
  • Uninstalled and reinstalled “ggpubr”
  • Uninstalled/Re-installed RStudio

After looking at other topics, I also ran renv::diagnostics. The output is huge, and I have posted it below. I am new to all of this, so any help is appreciated!

Here is the output of the following code:


renv::diagnostics()

Diagnostics Report [renv 0.14.0-8]

Session Info =======================

R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252
[3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C
[5] LC_TIME=English_Canada.1252

attached base packages:
[1] stats graphics grDevices datasets utils methods base

other attached packages:
[1] reprex_2.0.1 dplyr_1.0.7 ggplot2_3.3.5

loaded via a namespace (and not attached):
[1] tidyselect_1.1.1 xfun_0.26 purrr_0.3.4 haven_2.4.3
[5] colorspace_2.0-2 vctrs_0.3.8 generics_0.1.0 htmltools_0.5.2
[9] yaml_2.2.1 utf8_1.2.2 rlang_0.4.11 pillar_1.6.4
[13] foreign_0.8-81 glue_1.4.2 withr_2.4.2 lifecycle_1.0.1
[17] munsell_0.5.0 ggsignif_0.6.3 gtable_0.3.0 evaluate_0.14
[21] knitr_1.36 forcats_0.5.1 callr_3.7.0 fastmap_1.1.0
[25] ps_1.6.0 curl_4.3.2 fansi_0.5.0 highr_0.9
[29] broom_0.7.9 Rcpp_1.0.7 clipr_0.7.1 renv_0.14.0-8
[33] scales_1.1.1 backports_1.2.1 fs_1.5.0 hms_1.1.1
[37] digest_0.6.28 processx_3.5.2 grid_4.1.0 cli_3.0.1
[41] tools_4.1.0 magrittr_2.0.1 tibble_3.1.5 crayon_1.4.1
[45] tidyr_1.1.4 pkgconfig_2.0.3 ellipsis_0.3.2 data.table_1.14.2
[49] rmarkdown_2.11 rstudioapi_0.13 R6_2.5.1 compiler_4.1.0

Project ============================

Project path: "~/Documents/School/Data/Organized Analysis (Using Renv)/Test"

Status =============================

  • The project is already synchronized with the lockfile.

Packages ===========================

             Library Source Lockfile Source Path Dependency

KernSmooth 2.23-20 CRAN [2]
MASS 7.3-54 CRAN [2]
Matrix 1.3-3 CRAN [2]
MatrixModels 0.5-0 CRAN [1]
R6 2.5.1 CRAN [1]
RColorBrewer 1.1-2 CRAN [1]
Rcpp 1.0.7 CRAN [1]
RcppArmadillo 0.10.7.0.0 CRAN [1]
RcppEigen 0.3.3.9.1 CRAN [1]
SparseM 1.81 CRAN [1]
abind 1.4-5 CRAN [1]
backports 1.2.1 CRAN [1]
base64enc 0.1-3 CRAN [1]
bit 4.0.4 CRAN [1]
bit64 4.0.5 CRAN [1]
boot 1.3-28 CRAN [2]
broom 0.7.9 CRAN [1]
callr 3.7.0 CRAN [1]
car 3.0-11 CRAN [1]
carData 3.0-4 CRAN [1]
cellranger 1.1.0 CRAN [1]
class 7.3-19 CRAN [2]
cli 3.0.1 CRAN [1]
clipr 0.7.1 CRAN [1]
cluster 2.1.2 CRAN [2]
codetools 0.2-18 CRAN [2]
colorspace 2.0-2 CRAN [1]
conquer 1.0.2 CRAN [1]
corrplot 0.90 CRAN [1]
cowplot 1.1.1 CRAN [1]
cpp11 0.4.0 CRAN [1]
crayon 1.4.1 CRAN [1]
curl 4.3.2 CRAN [1]
data.table 1.14.2 CRAN [1]
digest 0.6.28 CRAN [1]
dplyr 1.0.7 CRAN [1]
ellipsis 0.3.2 CRAN [1]
evaluate 0.14 CRAN [1]
fansi 0.5.0 CRAN [1]
farver 2.1.0 CRAN [1]
fastmap 1.1.0 CRAN [1]
forcats 0.5.1 CRAN [1]
foreign 0.8-81 CRAN [2]
fs 1.5.0 CRAN [1]
generics 0.1.0 CRAN [1]
ggplot2 3.3.5 CRAN [1]
ggpubr 0.4.0 CRAN [1]
ggrepel 0.9.1 CRAN [1]
ggsci 2.9 CRAN [1]
ggsignif 0.6.3 CRAN [1]
glue 1.4.2 CRAN [1]
gridExtra 2.3 CRAN [1]
gtable 0.3.0 CRAN [1]
haven 2.4.3 CRAN [1]
highr 0.9 CRAN [1]
hms 1.1.1 CRAN [1]
htmltools 0.5.2 CRAN [1]
isoband 0.2.5 CRAN [1]
jquerylib 0.1.4 CRAN [1]
jsonlite 1.7.2 CRAN [1]
knitr 1.36 CRAN [1]
labeling 0.4.2 CRAN [1]
lattice 0.20-44 CRAN [2]
lifecycle 1.0.1 CRAN [1]
lme4 1.1-27.1 CRAN [1]
magrittr 2.0.1 CRAN [1]
maptools 1.1-2 CRAN [1]
markdown 1.1 CRAN [1]
matrixStats 0.61.0 CRAN [1]
mgcv 1.8-35 CRAN [2]
mime 0.12 CRAN [1]
minqa 1.2.4 CRAN [1]
munsell 0.5.0 CRAN [1]
nlme 3.1-152 CRAN [2]
nloptr 1.2.2.2 CRAN [1]
nnet 7.3-16 CRAN [2]
numDeriv 2016.8-1.1 CRAN [1]
openxlsx 4.2.4 CRAN [1]
pbkrtest 0.5.1 CRAN [1]
pillar 1.6.4 CRAN [1]
pkgconfig 2.0.3 CRAN [1]
polynom 1.4-0 CRAN [1]
prettyunits 1.1.1 CRAN [1]
processx 3.5.2 CRAN [1]
progress 1.2.2 CRAN [1]
ps 1.6.0 CRAN [1]
purrr 0.3.4 CRAN [1]
quantreg 5.86 CRAN [1]
readr 2.0.2 CRAN [1]
readxl 1.3.1 CRAN [1]
rematch 1.0.1 CRAN [1]
renv 0.14.0-8 GitHub 0.14.0-8 GitHub [1] direct
reprex 2.0.1 CRAN [1]
rio 0.5.27 CRAN [1]
rlang 0.4.11 CRAN [1]
rmarkdown 2.11 CRAN [1]
rpart 4.1-15 CRAN [2]
rstatix 0.7.0 CRAN [1]
rstudioapi 0.13 CRAN [1]
scales 1.1.1 CRAN [1]
sp 1.4-5 CRAN [1]
spatial 7.3-14 CRAN [2]
stringi 1.7.5 CRAN [1]
stringr 1.4.0 CRAN [1]
survival 3.2-11 CRAN [2]
tibble 3.1.5 CRAN [1]
tidyr 1.1.4 CRAN [1]
tidyselect 1.1.1 CRAN [1]
tinytex 0.34 CRAN [1]
tzdb 0.1.2 CRAN [1]
utf8 1.2.2 CRAN [1]
utils [2] indirect
vctrs 0.3.8 CRAN [1]
viridisLite 0.4.0 CRAN [1]
vroom 1.5.5 CRAN [1]
withr 2.4.2 CRAN [1]
xfun 0.26 CRAN [1]
yaml 2.2.1 CRAN [1]
zip 2.2.0 CRAN [1]

[1]: C:/Users/Kirsten/Documents/Documents/School/Data/Organized Analysis (Using Renv)/Test/renv/library/R-4.1/x86_64-w64-mingw32
[2]: C:/Users/Kirsten/AppData/Local/Temp/RtmpqWm6kF/renv-system-library

User Profile =======================

[no user profile detected]

Settings ===========================

List of 8
external.libraries : chr(0) ignored.packages : chr(0)
package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo" r.version : chr(0)
snapshot.type : chr "implicit" use.cache : logi TRUE
vcs.ignore.library : logi TRUE vcs.ignore.local : logi TRUE

Options ============================

List of 8
defaultPackages : chr [1:6] "datasets" "utils" "grDevices" "graphics" ... download.file.method : chr "wininet"
download.file.extra : NULL install.packages.compile.from.source: chr "interactive"
pkgType : chr "both" repos : Named chr "https://cran.rstudio.com"
..- attr(*, "names")= chr "CRAN"
renv.consent : logi TRUE renv.verbose : logi TRUE

Environment Variables ==============

HOME = C:/Users/Kirsten/Documents
LANG =
MAKE =
R_LIBS =
R_LIBS_SITE =
R_LIBS_USER = C:/Users/Kirsten/Documents/Documents/School/Data/Organized Analysis (Using Renv)/Test/renv/library/R-4.1/x86_64-w64-mingw32;C:/Users/Kirsten/AppData/Local/Temp/RtmpqWm6kF/renv-system-library
RENV_DEFAULT_R_ENVIRON =
RENV_DEFAULT_R_ENVIRON_USER =
RENV_DEFAULT_R_LIBS =
RENV_DEFAULT_R_LIBS_SITE =
RENV_DEFAULT_R_LIBS_USER = C:/Users/Kirsten/Documents/R/win-library/4.1
RENV_DEFAULT_R_PROFILE =
RENV_DEFAULT_R_PROFILE_USER =
RENV_PROJECT = C:/Users/Kirsten/Documents/Documents/School/Data/Organized Analysis (Using Renv)/Test

PATH ===============================

  • C:\Program Files\R\R-4.1.0\bin\x64
  • C:\WINDOWS\system32
  • C:\WINDOWS
  • C:\WINDOWS\System32\Wbem
  • C:\WINDOWS\System32\WindowsPowerShell\v1.0\
  • C:\WINDOWS\System32\OpenSSH\
  • C:\Program Files\Novell\iPrint
  • C:\Program Files\Git\cmd
  • C:\Users\Kirsten\AppData\Local\Microsoft\WindowsApps
  • C:\Users\Kirsten\AppData\Local\Programs\MiKTeX\miktex\bin\x64\
  • C:\Users\Kirsten\AppData\Roaming\TinyTeX\bin\win32

Cache ==============================

There are a total of 114 package(s) installed in the renv cache.
Cache path: "C:/Users/Kirsten/AppData/Local/renv/cache/v5/R-4.1/x86_64-w64-mingw32"

Thanks for the bug report -- unfortunately, I was unable to reproduce locally.

One thing you might try; does calling renv::rebuild() in the project help? This will force renv to reinstall any packages installed in the project, which may help alleviate the issue.

If using renv then you shouldn't have this code line in your script. A renv::restore() would be sufficient?

Yes, you are correct. I typically have that line commented out.

IT WORKED!!!! Thank you so much!

This topic was automatically closed 21 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.