LaTeX2Exp — transform LaTeX strings into R expressions

latex2exp is a new R package that parses and converts LaTeX math formulas into R’s plotmath expressions. Plotmath expressions are used to enter mathematical formulas and symbols to be rendered as text, axis labels, etc. throughout R’s plotting system. I find plotmath expressions to be quite opaque and fiddly; LaTeX is a de-facto standard for mathematical expressions, so this package might be useful to others as well. You can check it out on GitHub.

unnamed-chunk-4-1

unnamed-chunk-5-1

“Supported” LaTeX

Only a subset of LaTeX is supported, and not 100% correctly. Greek symbols (\alpha, \beta, etc.) and the usual operators (+, -, etc.) are supported. Additionally, the following symbols and operators should be supported:

unnamed-chunk-10-1

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>