Convert data.frame to roxygen2 tabular format
tabular(df, header = TRUE, ...)
data.frame to convert to table
boolean to control if header is created from names(df), Default: TRUE
arguments to pass to format
character
tabular(mtcars[1:5, 1:5])
#> #' \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(mtcars[1:5, 1:5],header=FALSE)
#> #' \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
#> #'}