davidgohel / flextable

table farming
https://ardata-fr.github.io/flextable-book/
554 stars 79 forks source link

R 4.4.0 and flextable_to_rmd: Error in .make_numeric_version() #630

Closed Steinthal closed 4 months ago

Steinthal commented 4 months ago

The generation of this Quarto file stops due to an error then using R 4.4.0. It is generated correctly with R 4.3.3:

---
title: "Test Flextable"
format: pdf
---

```{r}
#| warning: false
#| message: false
#| echo: false

library(flextable)
library(knitr)
#| warning: false
#| message: false
#| echo: false
#| output: asis

ft <- flextable(head(mtcars)) |>
  autofit() |>
  flextable_to_rmd()


## Error message

"processing file: test_flextable.qmd
|.......................................... | 80% [unnamed-chunk-2]
Quitting from lines at lines 17-30 [unnamed-chunk-2] (test_flextable.qmd)

Error in .make_numeric_version():
! invalid non-character version specification 'x' (type: double)

Backtrace:

flextable::flextable_to_rmd(autofit(flextable(head(mtcars))))
flextable:::is_in_quarto()
base::Ops.numeric_version(...)
base::as.numeric_version(e1)
base::numeric_version(x)
base::.make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version)
Execution halted"

## Environment

- Rstudio Version 2024.04.0+735 (2024.04.0+735)
- R version: 4.4.0
- flextable 0.9.5
davidgohel commented 4 months ago

see

Steinthal commented 4 months ago

Umm, sorry, didn't see those before posting.