我在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以下是所呈现的:
发布于 2021-04-28 12:58:29
我试过不使用roxygen,如果能帮上忙的话,它能起作用..
发布于 2022-08-18 20:52:12
您可以尝试将\mjdeqn替换为\mjsdeqn
#' 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
#' \mjsdeqn{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)),}https://stackoverflow.com/questions/67208363
复制相似问题