View source: R/format_fs_details.R
| format_fs_details | R Documentation |
Captures forestsearch(details = TRUE) console output and splits it
into two columns for readable beamer slides. Left column shows variable
selection (GRF, LASSO, candidate factors); right column shows subgroup
search, consistency evaluation, and results.
format_fs_details(
fs_output,
split_after = "Candidate factors",
fontsize = "scriptsize",
col_widths = c(0.48, 0.52),
max_width = 48
)
fs_output |
Character vector of captured output lines from
|
split_after |
Character string (regex). The output is split after the
block matching this pattern. Default: |
fontsize |
Character. LaTeX font size for the output text.
One of |
col_widths |
Numeric vector of length 2. Column widths as fractions
of |
max_width |
Integer. Maximum character width per line before wrapping. Long lines are wrapped at comma or space boundaries with a 4-space continuation indent. Default: 48 (suitable for half-slide columns at scriptsize). |
Invisibly returns a list with left and right
character vectors. Side effect: emits LaTeX via cat() for use
in a chunk with results='asis'.
No special LaTeX packages required. Works in any beamer frame
without the fragile option.
In a Quarto beamer chunk with results='asis' and
echo=FALSE, first capture the forestsearch output with
capture.output(), then call format_fs_details(fs_output).
## Not run:
fs_output <- capture.output(
fs_res <- forestsearch(
df = dat, outcome.name = "time", event.name = "status",
treat.name = "trt", id.name = "id",
confounders.name = confs, details = TRUE
)
)
# Default: split after candidate factors
format_fs_details(fs_output, fontsize = "tiny")
# Custom split: after filtering summary
format_fs_details(fs_output, split_after = "Found.*candidate")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.