Search code examples
ruser-interfacerevolution-rhelpfile

How to see mathematical expressions correctly in a Help html of a function (appearing after right-click) in R GUI?


I am using 32-bit Revolution R Enterprise (7.3) GUI for R (3.1.1) on 64-bit Windows 8.1.

When a function (say, urca::ca.jo) is right-clicked in Object Browser of RevoREnt after its package is loaded, an html file is shown in an opened window: in my notebook, it is http://127.0.0.1:25449/library/urca/html/ca.jo.html whose title is "R: Johansen Procedure for VAR - Revolution R Enterprise Help - Microsoft Document Explorer".

In this window, unfortunately, mathematical expressions are displayed in a latex-type code such as:

Details
Given a general VAR of the form:
\bold{X}_t = \bold{Π}1 \bold{X}{t-1} + … + \bold{Π}k \bold{X}{t-k} + \bold{μ} + \bold{Φ D}_t + \bold{\varepsilon}_t , \quad (t = 1, …, T),

Naturally, understanding what is going on from these expressions are really cumbersome. I am going to the PDF file of the related package to see clearly what these expressions are. Is not there any way to see them in the right-clicked-opened-window without going to PDF file?

By the way, I do not know whether this behaviour is same in "Base R" and "RStudio" GUIs.

I think there are many coder in my position, surely, we would greatly appreciate any help to this issue.


Solution

  • http://127.0.0.1 is a location on your computer, not accessible to anyone else. All users have a similar mechanism for viewing their help files. The authors of that package do not appear to understand how to write expressions in the particular markdown/markup language that the R help browser uses. That's what we are all seeing. You should probably look at the PDF version of that function's documentation: Page 11 of https://cran.r-project.org/web/packages/urca/urca.pdf

    If you look at the "Writing R Extensions" document you will find the secret incantation in section 2.6 which on my machine is at: http://127.0.0.1:29569/doc/manual/R-exts.html#Mathematics (but it appears that the port is different on your machine.) To find it I simply searched on the word "Greek" in that document:

    To this end, the two commands \eqn{latex}{ascii} and \deqn{latex}{ascii} are used. Whereas \eqn is used for “inline” formulae (corresponding to TeX’s $…$), \deqn gives “displayed equations” (as in LaTeX’s displaymath environment, or TeX’s $$…$$). Both arguments are treated as ‘verbatim’ text.