Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pander表中的空白单元格_R_R Markdown_Pander - Fatal编程技术网

Pander表中的空白单元格

Pander表中的空白单元格,r,r-markdown,pander,R,R Markdown,Pander,有没有办法在rmarkdown中创建一个pander表,以便带有NA(例如下表)的单元格显示为完全空白 --- title: "Untitled" author: "Llew Mills" date: "24 June 2016" output: pdf_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(fig.width=12, fig.height=8, fig.path='Figs/',

有没有办法在rmarkdown中创建一个pander表,以便带有
NA
(例如下表)的单元格显示为完全空白

---
title: "Untitled"
author: "Llew Mills"
date: "24 June 2016"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(fig.width=12, fig.height=8, fig.path='Figs/', 
                      echo=FALSE, warning=FALSE, message=FALSE, dev = 'pdf')
```

``` {r stuff}

library(pander)

m1 <- sample(1:10,6)
m2 <- sample(1:10,6)
m3 <- sample(1:10,6)
mR <- c("Group A", NA, NA, "Group B", NA, NA)
df <- data.frame(mR,m1,m2,m3)

pander(df, justify = "right", style = "simple")
```
---
标题:“无标题”
作者:“Llew Mills”
日期:“2016年6月24日”
输出:pdf\U文件
---
```{r设置,include=FALSE}
knitr::opts_chunk$set(图宽=12,图高=8,图路径='Figs/',
echo=FALSE、warning=FALSE、message=FALSE、dev=pdf)
```
```{r stuff}
图书馆(潘德尔)

m1是的,
缺少的
参数是您的朋友:

> pander(df, justify = "right", style = "simple", missing = "")


       mR   m1   m2   m3
--------- ---- ---- ----
  Group A    5    4    7
             4    9   10
             3    2    1
  Group B    8    8    5
             6   10    3
             1    7    6
或者通过
panderOptions
全局启用该选项:

> panderOptions('missing', '')
> pander(df, justify = "right", style = "simple")


       mR   m1   m2   m3
--------- ---- ---- ----
  Group A    5    4    7
             4    9   10
             3    2    1
  Group B    8    8    5
             6   10    3
             1    7    6

好极了打开了一个巨大的可能性范围。谢谢你@daroczig!