metrumresearchgroup / yspec

Data Specification for Pharmacometrics
https://metrumresearchgroup.github.io/yspec
5 stars 2 forks source link

ys_table function #98

Closed kylebaron closed 2 years ago

kylebaron commented 2 years ago

Summary

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())

Created on 2022-01-06 by the reprex package (v2.0.1)