I'm trying to insert an equation in to an R documentation such that:
\deqn{p_{x}(1)=Pr(y=1|x)}
but it does come out as I expected where x is a subscript of p.
Does anybody know the reason OR how to subscript p in R documentation?
I'm trying to insert an equation in to an R documentation such that:
\deqn{p_{x}(1)=Pr(y=1|x)}
but it does come out as I expected where x is a subscript of p.
Does anybody know the reason OR how to subscript p in R documentation?
The subscript will only render properly in the pdf version of your documentation, the HTML version is ASCII only as far as I know. To provide both a latex version of your equation for the pdf as well as a simplified equation for the html help, you can use both arguments of \deqn{<<latex>>}{<<plain>>}
. Take a look for example at the documentation of the `geigen
package for a few examples of providing both:
\deqn{A x = \lambda Bx}{A*x = lambda B*x}
\deqn{(A,B) = (Q S Z^H, Q T Z^H)}{(A,B) = (Q*S*Z^H, Q*T*Z^H)}
You can do
\ifelse{html}{\out{p_<sub>x</sub>(1)=Pr(y=1|x)}}{\eqn{p_x(1)=Pr(y=1|x)}}
© 2022 - 2024 — McMap. All rights reserved.