The primary use case for this function is for creating TeX tables which can
be included in a report Appendix. See more in details.
ys_table(spec, fun = NULL, tex = TRUE, widths_ = c(0.75, 1.95, 0.6, 2.15), ...)a yspec object
a function to format a TeX table; if NULL (the default), the
table will be rendered using fda_table()
logical; if TRUE, switch to tex namespace if it exists
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
The table text generated from fun.
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.
spec <- ys_help$spec()
tab <- ys_table(spec)
writeLines(text = tab, con = tempfile(fileext=".tex"))
formals(fda_table)$widths
#> c(0.75, 2.1, 0.6, 2.2)
formals(ys_table)$widths_
#> c(0.75, 1.95, 0.6, 2.15)