Learn R Programming

EmpiricalDynamics (version 0.1.2)

to_latex: Convert Equation to LaTeX

Description

Converts a discovered equation to LaTeX format for publication.

Usage

to_latex(
  equation,
  variable = "Z",
  precision = 3,
  scientific_notation = TRUE,
  include_uncertainty = FALSE,
  se_values = NULL
)

Value

Character string with LaTeX equation.

Arguments

equation

Fitted equation object.

variable

Name of the dependent variable (for dZ/dt notation).

precision

Number of decimal places for coefficients.

scientific_notation

Use scientific notation for large/small coefficients.

include_uncertainty

Include standard errors in parentheses.

se_values

Named vector of standard errors (optional).

Examples

Run this code
# Toy example using a linear model
data <- data.frame(Z = 1:10, dZ = 2 * (1:10) + 3)
model <- stats::lm(dZ ~ Z, data = data)

# Convert to LaTeX
latex_eq <- to_latex(model, variable = "Z")
cat(latex_eq)

Run the code above in your browser using DataLab