html - library(table1) :将质量最好的表提取为单词
问题描述
我已经为我的描述表使用了库表 1。我的问题是关于导出 Word 文档的输出表。我不知道如何提取质量最好的表。(我没有任何问题可以编织到 HTML,但我在导出 word 和 PDF 表时遇到问题。)我的 bookdown 设置如下面所述:
---
title: "Untitled"
author: "Marjan"
date: "3/29/2021"
output:
pdf_document:
toc: yes
word_document:
toc: yes
html_document:
toc: yes
toc_float:
collapsed: no
smooth_scroll: no
---
这是我的代码的一个子集:
```{r echo = FALSE, results = FALSE, message = FALSE, warning = FALSE, error = FALSE}
table1(~ factor(sex ) + age + factor(race) + education +factor(marital) + bmi + factor(smoke) + activity +factor(dominant)+allgrip
| cancer, data=main)
label(main$sex)<- "Sex % (N)"
label(main$age)<- "Age"
label(main$race)<- "Race(N)"
label(main$education) <- "Education % (N)"
label(main$marital)<- "Marital status % (N)"
label(main$bmi)<- "Body mass index (kg/m2)(SD)"
label(main$smoke)<- "Current daily smoker % (N)"
label(main$activity) <- " Work activity"
label(main$dominant)<- "Dominant hand % (N)"
label(main$allgrip) <- "Grip Strength/Kg"
table1(~ sex + age + race + education +marital
+bmi + smoke + activity +dominant+allgrip
| cancer, data=main,overall=F, topclass="Rtable1-zebra",render.missing=NULL)
knitr::opts_chunk$set(echo = TRUE)
```
解决方案
推荐阅读
- angular - 在普通函数中使用 TranslateService(没有类/构造函数)
- python - 如何使用python“switch”语句在单个语句下分配一系列可能的值
- javascript - take div's id by referencing this
- angular - ng deep样式为Angular 5中的不同组件分开
- javascript - 单击文档上的任意位置时隐藏弹出框
- android - IT 管理员如何使用托管配置配置 Android 应用
- css - HTML 导航栏链接不可点击
- python - 如何通过编写新的 admin.ModelAdmin 在 Wagtail 1.8 中创建自定义用户模型?
- amp-html - 在现有的响应式网站上实施 AMP
- ios - 将属性分配给自身