| latexrms | R Documentation |
Creates a file containing a LaTeX representation of the fitted model. For
model-specific typesetting there is latex.lrm, latex.cph,
latex.psm and latex.ols. latex.cph has some
arguments that are specific to cph models.
latexrms is the core function which is
called internally by latexrms (which is called by
latex.cph, latex.ols, etc.). html and R
Markdown-compatible markup (using MathJax) are written if
options(prType='html').
latexrms(object,
file='',
append=FALSE, which=1:p, varnames, columns=65, prefix=NULL, inline=FALSE,
before=if(inline)"" else "& &", after="", intercept, pretrans=TRUE,
digits=.Options$digits, size="")
object |
a fit object created by a fitting function in the |
file |
name of |
append |
whether or not to append to an existing file |
which |
a vector of subcripts (corresponding to |
varnames |
variable names to substitute for non-interactions. Order must correspond
to |
columns |
maximum number of columns of printing characters to allow before outputting a LaTeX newline command |
prefix |
if given, a LaTeX \lefteqn command of the form |
inline |
Set to |
before |
a character string to place before each line of output. Use the default
for a LaTeX |
after |
a character string to place after the output if |
intercept |
a special intercept value to include that is not part of the standard
model parameters (e.g., centering constant in Cox model). Only allowed
in the |
pretrans |
if any spline or polynomial-expanded variables are themselves
transformed, a table of pre-transformations will be formed unless
|
digits |
number of digits of precision to use in formatting coefficients and other numbers |
size |
a LaTeX font size to use for the output, without the slash. Default is current size. |
latexrms returns a character vector if file='',
otherwise writes the output to file. For particular model
fits, the latex method returns the result of running
knitr::asis_output on the LaTeX or HTML code if file='',
options(prType) was set but not to 'plain', and if
knitr is currently running. This causes correct output to be
rendered whether or not results='asis' appeared in the R
Markdown or Quarto chunk header.
Frank Harrell
Department of Biostatistics, Vanderbilt University
fh@fharrell.com
latex, rcspline.restate,
rms
## Not run:
f <- lrm(death ~ rcs(age)+sex)
w <- latex(f, file='f.tex')
w # displays, using e.g. xdvi
latex(f) # send LaTeX code to console, as for knitr
options(prType='html')
latex(f) # emit html and latex for knitr html and html notebooks
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.