Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the roxygen2 package support tables?

I'm wanting to try using markdown in .Rd files. I think I get that @md at the end of the documentation for a function makes it parse markdown. But not see this table appear, nor is the raw text appearing... Does roxygen support tables?

#' makes bar
#' @description
#' prints 2 x
#' @details see this table
#' 
#' |a |b |c |
#' |--|--|--|
#' |1 |3 |4 |
#'
#' @param x how much foo
#' @return - 
#' @export
#' @family tmp
#' @examples
#' foo(2)
#' @md
foo <- function(x) {
    print(2 * x)
}
like image 664
tim Avatar asked Mar 25 '17 13:03

tim


1 Answers

There is now support for markdown tables in roxygen2 since the 7.0.0 version (on CRAN since 2019-11-12):

Markdown tables are converted to a \tabular{} macro (#290). roxygen2 supports the GFM table syntax which looks like this:

| foo | bar | 
| --- | --- | 
| baz | bim | 

You can read more about this in the dedicated roxygen2 vignette.

like image 136
Droplet Avatar answered Sep 22 '22 17:09

Droplet