latexr: Translate 'LaTeX' Formulas to R Code

Implements a minimal 'LaTeX' parser that translates mathematical formulas into R code strings. Supports arithmetic operators, implicit multiplication, fractions, Greek letters, common mathematical functions, and statistical notation for means, medians, and rolling sums. Input from visual formula editors such as 'MathQuill' is normalized automatically, and the resulting string can be evaluated with parse() and eval(), or converted into an R function with latex2fun(). The implementation follows the tree-walking interpreter design of Nystrom (2021) <https://craftinginterpreters.com/>.

Getting started

Package details

AuthorRodrigo Borges [aut, cre], Tomas Capretto [aut, ctb]
MaintainerRodrigo Borges <rodrigo@borges.net.br>
LicenseMIT + file LICENSE
Version0.3.0
URL https://github.com/rodrigoesborges/latexr 
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("latexr")

Try the latexr package in your browser

Any scripts or data that you put into this service are public.

latexr documentation built on Sept. 30, 2026, 5:08 p.m.