gpt4 book ai didi

r - 用于 conflr 的 DT(htmlwidgets 内容)

转载 作者:行者123 更新时间:2023-12-05 04:24:56 25 4
gpt4 key购买 nike

对于使用 {rmarkdown} 无服务器渲染表有什么建议吗?我需要这样做,以便在 {conflr} 的帮助下将呈现的 HTML 推送到 Confluence 页面。

当我在 RMD 文件中渲染如下内容,然后尝试使用 conflr:::confl_create_post_from_Rmd_addin() 发送到 Confluence 时,我收到此错误:

output file: serverless_test.knit.md

Error: Functions that produce HTML output found in document targeting commonmark-yaml_metadata_block output.
Please change the output type of this document to HTML. Alternatively, you can allow
HTML output in non-HTML formats by adding this option to the YAML front-matter of
your rmarkdown file:

always_allow_html: true

Note however that the HTML output will not be visible in non-HTML formats.

添加建议标志后,表格仍然没有呈现。

如果我尝试在本地运行它而不使用 DT:renderDT(..., server = FALSE) 推送到 Confluence,我会收到警告 This R Markdown document contains Shiny content,但被呈现为静态文件。文档中 Shiny 的内容可能不会出现,也不会进行交互。 此外,filter = "top"在每列顶部呈现文本框以过滤列内容,但当您输入文本时,什么也没有发生。

---
title: "serverless_dt"
author: "Matt Wood"
date: "2022-08-17"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo=TRUE)
library(tidyverse)
library(DT)
```

```{r}
DT::datatable(iris)
# %>% DT::renderDT(server = FALSE)
```

conflr:::confl_create_post_from_Rmd_addin()

感谢您的帮助!

最佳答案

问题是 DataTables(DT) 库是一个 htmlwidgets 东西,conflr 不支持它。

您只能使用带有 block 选项的静态内容 screenshot.force = TRUE

关于r - 用于 conflr 的 DT(htmlwidgets 内容),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73395370/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com