我正在写一个R包,我想在R帮助文件中包含一个表,例如在@details
部分中。我尝试直接包含降价代码:
#' | Tables | Are | Cool |
#' | ------------- |:-------------:| -----:|
#' | col 3 is | right-aligned | $1600 |
#' | col 2 is | centered | $12 |
但是这不能给我想要的输出。我为整个软件包启用了markdown支持,并安装了roxygen2 6.0.1。是否不支持降价表?我必须使用\tabular{}
吗?
请注意,{roxygen}最后会生成R文档文件。因此,您始终可以转到Writing R Extensions: Lists and tables并手动以R-packages的本机文档语言编写表。
这是一个最小的示例:
\name{dummy}
\title{Dummy}
\details{
The example here is:
\tabular{lcc}{
Tables \tab Are \tab Cool \cr
col 3 is \tab right-aligned \tab $1600 \cr
col 2 is \tab centered \tab $12 \cr
}
}
注意,最新的{roxygen2}版本7.0为markdown语法提供了更多支持。