不使用Kable时的Bookdown表引用

时间:2017-09-11 17:38:04

标签: r knitr cross-reference bookdown kable

Yihui Xie的Bookdown书https://bookdown.org/yihui/bookdown/tables.html非常清楚,交叉引用系统需要对非kable表进行调整。本节的最后一段是关键,但(对我来说)是不可思议的,我希望能有一两个例子。

为了使问题稍微复杂一点,我的项目使用Rchunks,这可能会使任务复杂化。

但是,有没有人有书签交叉代码的例子(可能包括Rchunks,Rmd调用那些Rchunks或\ @ref(tab:...))他们会分享,哪些不叫kable?

1 个答案:

答案 0 :(得分:1)

不完全确定您要问的是什么,但这是一个与bookdown一起使用的手动类型表的示例:

R includes a lot of advanced mathematical functions. Table \@ref(tab:mathfunctions) shows a list of the most common functions.

Table: (\#tab:mathfunctions) Common mathematical functions in R.

| Function | Explanation | Example|
|----------|------------|-------------|
|   `abs(x)`  | Absolute value| `abs(-3) = 3`|
|   `sqrt(x)` | Square root | `sqrt(9) = 3` |
|   `log(x)`  | Natural logarithm | `log(10) = 2.303` |
|   `log10(x)`  | Base 10 logarithm | `log10(10) = 1` |
|   `log(x, base=2)`  | Base 2 logarithm | `log(10, base=2) = 3.322` |
|   `exp(x)`  | Exponential function | `exp(1) = 2.718` |


R also allows you to yada yada yada.
相关问题