Skip to content

TMP FIX: use a double in internal function is_in_quarto() #627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

TimTaylor
Copy link

I think something has changed in knitr or R4.4.0 but https://github.com/davidgohel/flextable/blob/8e21aaa98515e2feca5ea8b0cfab85b9d4a95aa3/R/printers.R#L1120C49-L1120C71 is broken with current CRAN packages and R4.4.0.

I think this fixes the issue but I've not dug further so treat accordingly.

I think something has changed in knitr or R4.4.0 but 
https://github.com/davidgohel/flextable/blob/8e21aaa98515e2feca5ea8b0cfab85b9d4a95aa3/R/printers.R#L1120C49-L1120C71
is broken with current CRAN packages and R4.4.0.

I think this fixes the issue but I've not dug further.
@davidgohel
Copy link
Owner

@TimTaylor could you share a reproducible example that shows the issue? Running the folllwing quarto doc does not show any issue:

---
title: "Untitled"
format: html
---

```{r}
flextable::as_flextable(iris)
```

@TimTaylor
Copy link
Author

Yeah will do. I'm waiting for someone to get back to me with one (I'm just debugging their error message 😅 ). Was waiting to raise an issue once I had one.

Apologies - pulled the trigger to quick on the PR!

@TimTaylor
Copy link
Author

TimTaylor commented Apr 29, 2024

@davidgohel - are you running R4.4.0? I'm utilising the version of Quarto bundled with Rstudio and dev version of flextable and can reproduce with your iris example.

R> packageVersion("flextable")
[1] '0.9.6.7'
R> R.version.string
[1] "R version 4.4.0 Patched (2024-04-25 r86484)"
~/opt/rstudio/latest/resources/app/bin/quarto/bin
$ ./quarto --version
1.4.553

~/opt/rstudio/latest/resources/app/bin/quarto/bin
$ ./quarto render ~/scrap/flextable.qmd 


processing file: flextable.qmd
1/3                  
2/3 [unnamed-chunk-1]

Quitting from lines  at lines 7-8 [unnamed-chunk-1] (flextable.qmd)
Error in `.make_numeric_version()`:
! invalid non-character version specification 'x' (type: double)
Backtrace:
  1. global .main()
  2. execute(...)
  3. rmarkdown::render(...)
  4. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
  5. knitr:::process_file(text, output)
     ...
 26. flextable:::is_in_quarto()
 28. base::Ops.numeric_version(...)
 29. base::as.numeric_version(e1)
 30. base::numeric_version(x)
 31. base::.make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version)
Execution halted

@davidgohel
Copy link
Owner

thanks, I can reproduce.

@davidgohel
Copy link
Owner

thanks, I will push a fix but with a condition to make sure it still works with older version of R

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants