【问题标题】:Using mathjaxr to get nice display in r package documentation使用 mathjaxr 在 r 包文档中获得漂亮的显示
【发布时间】:2021-07-16 09:17:39
【问题描述】:

我在使用 mathjaxr 包时遇到困难,无法在 我的第一个包的文档中很好地显示。

我按照此处给出的说明进行操作:https://rdrr.io/github/wviechtb/mathjaxr/man/mathjaxr-package.html

这是我在函数之前放入 R 文件的内容:

#' Probabilistic principal component analysis :
#' parameter estimation with EM algorithm
#'
#' @param Y les données : une matrice de taille n x p
#' @param Gamma0 point de départ pour l'inférence de Gamma
#'
#' @return la fonction renvoie la moyenne d'un vecteur
#' @import mvtnorm
#' @import psych
#' @import mathjaxr
#' @description 
#' \loadmathjax
#' \mjdeqn{f(x) = \frac{1}{\sqrt{2\pi} \sigma} e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}#\right)^2},}
#' {f(x) = 1/(sqrt(2 pi) sigma) e^-((x - mu)^2/(2 sigma^2)),}

这是我的描述文件中的内容:

Package: ppcaem
Title: Parameter estimation in ppca model with EM algorithm
Version: 0.0.0.9000
Authors@R: 
    person(given = "First",
           family = "Last",
           role = c("aut", "cre"),
           email = "first.last@example.com",
           comment = c(ORCID = "YOUR-ORCID-ID"))
Description: cf title
RdMacros: mathjaxr
License: GPL-3
Encoding: UTF-8
LazyData: true
Imports: 
    psych,
    mvtnorm,
    mathjaxr
RoxygenNote: 7.1.1

这里是渲染的:

mathjaxr

【问题讨论】:

    标签: r mathjax r-package


    【解决方案1】:

    我试过不使用 roxygen 并且它可以工作,如果它可以帮助的话..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-25
      • 2010-12-03
      • 2011-07-06
      • 1970-01-01
      • 2021-08-05
      相关资源
      最近更新 更多