tables
包中的粘贴伪函数组合了单元格值,但它也引入了不必要的填充。见这个例子:
---
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tables)
library(dplyr)
```
```{r table, results='asis'}
seed <- 1
iris2 <- iris %>% mutate(Region = factor(sample(c('East', 'West', 'Central'), 150, replace = TRUE)))
tabular((Species + 1) ~ (Region + 1) * Sepal.Length * Paste(Percent(), length, sep = '\\% (', postfix = ')'),
data = iris2) %>%
latex %>%
print
```
注意括号内的填充。我该如何摆脱它?