Loading 'kableExtra' package

Hi guys
I'm a new user to rmarkdown and trying to learn how to format better tables for a report with qualitative data.
I had a report using the package "kableExtra" and it was fine. But now I cannot even load the package anymore and I do not know why.

This is the error I get:

"package of namespace load failed for 'kableExtra' in library.dynam(lib, package, package.lib):
DLL 'systemfonts' not found: maybe not installed for this architecture?
Execution halted"

Anyone can help me, please?

I am using RStudio 2022.02.0 Build 443
and R version 4.1.2 (2021-11-01) -- "Bird Hippie"

Thank you :slight_smile:

sessionInfo()
R version 4.1.2 (2021-11-01)
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 LC_MONETARY=English_Canada.1252 LC_NUMERIC=C
[5] LC_TIME=English_Canada.1252

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

loaded via a namespace (and not attached):
[1] knitr_1.38 magrittr_2.0.2 usethis_2.1.5 devtools_2.4.3 pkgload_1.2.4 R6_2.5.1 rlang_1.0.2
[8] fastmap_1.1.0 tools_4.1.2 pkgbuild_1.3.1 xfun_0.30 sessioninfo_1.2.2 cli_3.2.0 withr_2.5.0
[15] htmltools_0.5.2 ellipsis_0.3.2 remotes_2.4.2 yaml_2.3.5 digest_0.6.29 rprojroot_2.0.2 lifecycle_1.0.1
[22] crayon_1.5.1 brio_1.1.3 processx_3.5.2 purrr_0.3.4 callr_3.7.0 fs_1.5.2 ps_1.6.0
[29] testthat_3.1.2 evaluate_0.15 memoise_2.0.1 glue_1.6.2 cachem_1.0.6 rmarkdown_2.13 compiler_4.1.2
[36] desc_1.4.1 prettyunits_1.1.1

Have you tried reinstalling systemfonts?

install.packages("systemfonts")
1 Like

I've tried that, still not working and same error message. And I also included sessionInfo() above.

After installing 'systemfonts', library(systemfonts) gets me the error: Error: package ‘systemfonts’ is not installed for 'arch = x64' In addition: Warning message: package ‘systemfonts’ was built under R version 4.1.3

This suggests the installation process has failed

Please post the complete console output you get when you run

install.packages("systemfonts")
1 Like
install.packages("systemfonts")
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/
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/systemfonts_1.0.4.zip'
Content type 'application/zip' length 2021636 bytes (1.9 MB)
downloaded 1.9 MB

package ‘systemfonts’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  cannot delete reparse point 'C:\Users\cnetto\OneDrive - Harbour Air\Documents\R\R-4.1.2\library/systemfonts/libs', reason 'There is a mismatch between the tag specified in the request and the tag present in the reparse point'
Warning in install.packages :
  cannot remove prior installation of package ‘systemfonts’
Warning in install.packages :
  cannot delete reparse point 'C:\Users\cnetto\OneDrive - Harbour Air\Documents\R\R-4.1.2\library/systemfonts/libs', reason 'There is a mismatch between the tag specified in the request and the tag present in the reparse point'
Warning in install.packages :
  restored ‘systemfonts’

The downloaded binary packages are in
	C:\Users\cnetto\AppData\Local\Temp\RtmpuUgANs\downloaded_packages

Is this a Cloud synced folder? If so, R has problems installing packages on cloud synced folders, so I suggest you to set your package library in a non-synced folder.

You can change the default library folder by setting your R_LIBS_SITE environmental variable in a .Reviron or .Rprofile file. For example:

# In a .Renviron file you can set it by adding a line like this one with the desired location 
R_LIBS_SITE="C:\\Program Files\\R\\R-4.1.2\\library"

For a more detailed explanation, you can read this blog post

1 Like

Thank you, Andre!
It's running all good now.

It was the Cloud synced folder. I checked the link you sent and follow the steps on this one: Fix the R Library Bug on Windows 10 | Matthew Wildrick Thomas

Glad to hear you solved your problem, just be aware that using that method you are setting your library path at the operating system level, so if in the future this needs to be changed you have to remember that you set it this way because it is going to be independent of your R setup.

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.