PDF rendering of a symbolized_model in three stacked sections
Source:R/render-three-views.R
as_pdf_three_views.RdPaper-ready PDF counterpart to as_html_three_views(). The same three
"views" of one fitted model, laid out vertically as three sections on
one PDF page (no tabs):
Index form – the per-observation equations.
Matrix form – the same equations in matrix notation.
Worked observation – the index-form equations evaluated at observation i = 1 of the data, showing the coefficient estimates plugged in and the predicted / residual decomposition.
Rendered via rmarkdown::render() with output_format = "pdf_document";
a working LaTeX install (TinyTeX or system TeX) is required.
The wide matrix-of-numbers view from the HTML widget's third tab is deliberately not included – on PDF the bmatrix of n x p numbers overflows a portrait A4 page. The worked-row at i = 1 carries the same teaching content in a fits-on-one-page form.
Usage
as_pdf_three_views(
x,
file,
title = NULL,
head = 5L,
tail = 2L,
head_cols = 5L,
tail_cols = 2L,
keep_tex = FALSE,
...
)Arguments
- x
A
symbolized_model.- file
Output path (
.pdf). Required.- title
Optional document title. Defaults to a short auto-title built from the fit's class and response.
- head
Number of leading rows shown in any matrix block before the
\\vdotsellipsis (default5).- tail
Number of trailing rows shown after the
\\vdots(default2).- head_cols
Number of leading columns shown in any matrix block with more than
head_cols + tail_colscolumns (default5). Smart-truncation prefers non-zero columns within the visible row band.- tail_cols
Number of trailing columns shown after the
\\cdotsellipsis (default2).- keep_tex
If
TRUE, keep the intermediate.texnext to the PDF for inspection. DefaultFALSE.- ...
Passed to
rmarkdown::render().