ys_table calls fda_table() to make the same type of table that appears in define.pdf
The output is text and can be saved and then included in a report appendix
The output is longtable; there is no way at the moment to add proper caption; the idea is to include it in an appendix and write about the table in the appendix text
Might expand to include caption down the road
Modified fda_table to accept variable column widths
Example
library(yspec)
spec <- ys_select(ys_help$spec(), WT, AGE)
txt <- ys_table(spec)
cat(txt, sep = "\n")
#> \begin{longtable}{|>{\raggedright\arraybackslash}p{0.75in}|>{\raggedright\arraybackslash}p{1.95in}|>{\raggedright\arraybackslash}p{0.6in}|>{\raggedright\arraybackslash}p{2.15in}|}
#> \hline
#> VARIABLE & LABEL & TYPE & CODES \\
#> \hline
#> \endhead
#> \hline
#> \multicolumn{4}{l}{\footnotesize Continued on next page}
#> \endfoot
#> \endlastfoot
#> \hline
#> WT & weight (unit: kg) & numeric & \\
#> \hline
#> AGE & age (unit: years) & numeric & \\
#> \hline
#> \end{longtable}
writeLines(text = txt, con = tempfile())
Summary
ys_table
callsfda_table()
to make the same type of table that appears indefine.pdf
fda_table
to accept variable column widthsExample
Created on 2022-01-06 by the reprex package (v2.0.1)