ys_table: Create a table from yspec object

View source: R/fda_define.R

ys_tableR Documentation

Create a table from yspec object

Description

The primary use case for this function is for creating TeX tables which can be included in a report Appendix. See more in details.

Usage

ys_table(spec, fun = NULL, tex = TRUE, widths_ = c(0.75, 1.95, 0.6, 2.15), ...)

Arguments

spec

a yspec object

fun

a function to format a TeX table; if NULL (the default), the table will be rendered using fda_table()

tex

logical; if TRUE, switch to tex namespace if it exists

widths_

passed to fda_table() when fun is NULL; these are slightly modified from the fda_table() default (see examples); note the trailing underscore in the argument name; these shouldn't need to be changed for most use.

...

additional arguments passed to fun

Details

By default, the table code is rendered using fda_table(); this should be used in most cases. fda_table() returns the table in the longtable environment. This can be included in a report with ⁠\input{<file.tex>}⁠.

At this time, there is no mechanism for generating a caption for tables generated using fda_table(); the intended use is to include the table in an appendix, with caption information given in plain text in the appendix.

Value

The table text generated from fun.

Examples

spec <- ys_help$spec()
tab <- ys_table(spec)
writeLines(text = tab, con = tempfile(fileext=".tex"))

formals(fda_table)$widths
formals(ys_table)$widths_


metrumresearchgroup/yspec documentation built on May 24, 2024, 12:48 a.m.