In my quarto document, the following code works when I render the chuck.
```{r da-table, echo=FALSE, message=FALSE}
atsi.need <- datatable(iris)
atsi.need
but , outside of the chunk this gives me the following error:
Under ESSA student groups are identified for Additional Targeted Support and Improvement.
`r atsi.need`
and the error message is
Error in rep_len(label, length(meta)) :
cannot replicate NULL to a non-zero length
Calls: .main ... in_dir -> inline_exec -> sew -> <Anonymous> -> knit_meta_add
Execution halted
cderv
February 17, 2023, 10:57am
2
Your object is a datatable from DT - it can be used inline in knitr - it needs to be added in a chunk.
Inline chunk are only for string output (or one that could be coerced to string)
Do this
Under ESSA student groups are identified for Additional Targeted Support and Improvement.
```r
atsi.need
```
1 Like
cderv
February 17, 2023, 11:11am
3
But as this works with R Mardown and knitr quarto I have open an issue
opened 11:10AM - 17 Feb 23 UTC
closed 10:46PM - 02 Mar 23 UTC
bug
From https://community.rstudio.com/t/quarto-errors-out-when-calling-dt-inline/15… 9894/3
This works in R Mardown
````markdown
---
title: "Test"
output: html_document
---
```{r da-table}
#| echo: false
#| essage: FALSE
atsi.need <- DT::datatable(iris)
```
Under ESSA student groups are identified for Additional Targeted Support and Improvement.
`r atsi.need`
````
This does not in Quarto
````markdown
---
title: "test"
format: html
keep-md: true
---
Works
```{r da-table, echo=FALSE, message=FALSE}
atsi.need <- DT::datatable(iris)
atsi.need
```
but error
Under ESSA student groups are identified for Additional Targeted Support and Improvement.
`r atsi.need`
````
with this error
````
++ Activating rlang global_entrace
++ Setting QUARTO_PYTHON
processing file: test2.qmd
|...........................................................| 100% Quitting from lines 12-15 (test2.qmd)
Error in `rep_len()`:
! impossible de répliquer NULL vers une longueur non nulle
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)
...
9. knitr:::call_inline(x)
12. knitr:::inline_exec(block)
13. sew(res, inline = TRUE)
14. knitr:::sew.knit_asis(x, options, ...)
15. knitr::knit_meta_add(m, if (missing(options)) "" else options$label)
Message d'avis :
The closing backticks on line 11 ("````") in test2.qmd do not match the opening backticks "```" on line 7. You are recommended to fix either the opening or closing delimiter of the code chunk to use exactly the same numbers of backticks and same level of indentation (or blockquote).
Exécution arrêtée
++ Activating rlang global_entrace
````
Thanks for the report
system
Closed
April 3, 2023, 11:12am
4
This topic was automatically closed 45 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.