tabular: Tabular for roxygen2

Description Usage Arguments Value Source See Also Examples

Description

Convert data.frame to roxygen2 tabular format

Usage

1
tabular(df, header = TRUE, ...)

Arguments

df

data.frame to convert to table

header

boolean to control if header is created from names(df), Default: TRUE

...

arguments to pass to format

Value

character

Source

roxygen2 formatting

See Also

format

Examples

1
2
cat(tabular(mtcars[1:5, 1:5]))
cat(tabular(mtcars[1:5, 1:5],header=FALSE))

Example output

#' \tabular{rrrrr}{
    #' \strong{mpg} \tab \strong{cyl} \tab \strong{disp} \tab \strong{hp} \tab \strong{drat}\cr
    #' 21.0 \tab 6 \tab 160 \tab 110 \tab 3.90\cr
    #' 21.0 \tab 6 \tab 160 \tab 110 \tab 3.90\cr
    #' 22.8 \tab 4 \tab 108 \tab  93 \tab 3.85\cr
    #' 21.4 \tab 6 \tab 258 \tab 110 \tab 3.08\cr
    #' 18.7 \tab 8 \tab 360 \tab 175 \tab 3.15
#'}
#' \tabular{rrrrr}{
    #' 21.0 \tab 6 \tab 160 \tab 110 \tab 3.90\cr
    #' 21.0 \tab 6 \tab 160 \tab 110 \tab 3.90\cr
    #' 22.8 \tab 4 \tab 108 \tab  93 \tab 3.85\cr
    #' 21.4 \tab 6 \tab 258 \tab 110 \tab 3.08\cr
    #' 18.7 \tab 8 \tab 360 \tab 175 \tab 3.15
#'}

sinew documentation built on May 2, 2019, 10:21 a.m.

Related to tabular in sinew...