flextable not installing - Windows 10

Computer recently had a new OneDrive cloud drive installed for my job where every single file is back up onto it - this changed all pathways for R and started the problem.

All seem to have been restored now except one recurring error message when installing the felxtable package for R markdown - I see this issue has appeared previously on R communities. The core error message that repeats, surrounded by different text sometimes depending on various attempts that have been made, is:

library(flextable)

Error: package or namespace load failed for ‘flextable’ in library.dynam(lib, package, package.lib): DLL ‘digest’ not found: maybe not installed for this architecture?

The package unpacks and appears in the appropriate folder but the library does not recognise it.

Other error messages, with the same core message above within:

Installing package into ‘C:/Users/karen/OneDrive - name /Documents/R/win-library/4.0’ (as ‘lib’ is unspecified)

There is a binary version available but the source version is later: binary source needs_compilation flextable 0.6.4 0.6.5 FALSE

installing the source package ‘flextable’

trying URL 'https://cran.rstudio.com/src/contrib/flextable_0.6.5.tar.gz' Content type 'application/x-gzip' length 582996 bytes (569 KB) downloaded 569 KB

installing source package 'flextable' ... ** package 'flextable' successfully unpacked and MD5 sums checked ** using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading

Error in library.dynam(lib, package, package.lib) : DLL 'digest' not found: maybe not installed for this architecture?

Calls: ... loadNamespace -> namespaceImport -> loadNamespace -> library.dynam Execution halted ERROR: lazy loading failed for package 'flextable' removing 'C:/Users/karen/OneDrive - name /Documents/R/win-library/4.0/flextable' Warning in install.packages : installation of package ‘flextable’ had non-zero exit status

The downloaded source packages are in ‘C:\Users\karen\AppData\Local\Temp\RtmpUpt0zR\downloaded_packages’ library(flextable) Error in library(flextable) : there is no package called ‘flextable’

Tried so far:

  • updating R
  • uninstall and reinstall
  • creating directory for flextable with: loadNamespace(flextable) dir.create("~/R/win-library/4.0", recursive = TRUE)
  • searching Google for and loading packages that flextable may be dependent on such as digest and tidyverse
  • installing flextable as:

install.packages("flextable", type="binary", dependencies = TRUE, INSTALL_opts = c("--no-multiarch")) library(flextable)

None of these have worked and the exact same error message keeps returning. All other packages required are unpacking, installing and functioning correctly with library()

Have been going in circles for two days - any help is greatly appreciated - thank you in advance!

R version: [64-bit] 4.0.5

R has problems with cloud synced folders very often, I would recommend to set your package library in a non synced folder if possible.

You can change the default library folder by setting your R_LIBS_SITE environmental variable on a .Reviron or .Rprofile file

# In a .Renviron file you can set it by adding this line
R_LIBS_SITE="C:\\Program Files\\R\\R-4.0.5\\library"

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

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.