Search code examples
rquartoflextable

Flextable does not work anymore in quarto documents - Error: ! package or namespace load failed for 'flextable'


I love flextable and so I use it in a lot of projects.
After setup of a new Laptop where I installed R 4.4.1 and RStudio 2024.04.2 I had to see that

  • the flextable library (0.9.6) produces an error when it is attached in a quarto document (.qmd) but
  • there is no problem when it is attached in a RMarkdown document (.Rmd).

The error occurs immediately after klicking the render button of a .qmd file and looks like this:

Quitting from lines 9-13 [setup] (flextable_test.qmd)
Error:
! package or namespace load failed for 'flextable':
.onLoad failed in loadNamespace() for 'shiny', details:
call: .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version)
error: invalid non-character version specification 'x' (type: double)
Backtrace:

  1. base::library(flextable)
  2. base::tryCatch(...)
  3. base (local) tryCatchList(expr, classes, parentenv, handlers)
  4. base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  5. value[3L]

To reproduce that error it is only necessary to

  • create a new quarto document,
  • include library(flextable),
  • save the file in a directory 'project/src' and
  • render it.

To solve that error I tried to deinstall and install flextable again but that did not help.

Can anyone explain to me what that error message means exactly?


Solution

  • I don't know what exactly happens here, but after upgrading shiny to 1.9.1 the problem seems to be solved. Now I do not receive an error message. :-)