r仅在底部的可弹性水平线

发布于 2025-02-10 20:44:48 字数 787 浏览 0 评论 0 原文

我正在尝试从2x2矩阵中创建一个简单的弹力,其中第二列包括底部的水平线。输出需要是从.RMD文件创建的Word文档。第一行的顶部有一条额外的水平线,我不想要。它似乎在HTML输出中正常工作。

---
output: 
  word_document
---

```{r setup, message=FALSE, warning=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(flextable)
library(dplyr)

tab <- data.frame(
  x = c('Row1', 'Row2:'),
  y = c(NA, NA)
)

flextable::flextable(tab) %>%
  flextable::border_remove() %>%
  flextable::hline(i = 1:2, j = 2, part = 'body') %>%
  flextable::delete_part(part = 'header') 
```

输出在Word中看起来像这样:

​=“ nofollow noreferrer”> “

I'm trying to create a simple flextable from a 2x2 matrix where the second column includes horizontal lines on the bottom. The output needs to be a Word document created from a .Rmd file. There is an extra horizontal line at the top of the first row, which I do not want. It seems to work fine in html output.

---
output: 
  word_document
---

```{r setup, message=FALSE, warning=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(flextable)
library(dplyr)

tab <- data.frame(
  x = c('Row1', 'Row2:'),
  y = c(NA, NA)
)

flextable::flextable(tab) %>%
  flextable::border_remove() %>%
  flextable::hline(i = 1:2, j = 2, part = 'body') %>%
  flextable::delete_part(part = 'header') 
```

The output looks like this in Word:

enter image description here

And I want it to look like this (as in HTML):

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扎心 2025-02-17 20:44:48

这是一个错误,在这里修复,v0.7.3.006:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文