View source: R/format_results.R
| format_model_equation | R Documentation |
Converts a fitted earth model into a LaTeX-formatted mathematical representation using g-function notation. Basis functions are grouped by degree (constant, first-degree, second-degree, third-degree) and labeled with indices that encode the group, position, and factor variable count.
format_model_equation(earth_result, digits = 7L, response_idx = NULL)
earth_result |
An object of class |
digits |
Integer. Number of significant digits for coefficients and cut points. Default is 7. |
response_idx |
Integer or |
A list containing:
Character string. LaTeX array environment for HTML/MathJax rendering.
Character string. Wrapped in display math delimiters for MathJax/HTML rendering.
Character string. LaTeX for native PDF output with escaped special characters in text blocks.
Character string. LaTeX for Word/docx output.
List of group structures for programmatic access.
result <- fit_earth(mtcars, "mpg", c("cyl", "disp", "hp", "wt"))
eq <- format_model_equation(result)
cat(eq$latex)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.