Including images in R-package documentation (.Rd) files

前端 未结 1 2010
星月不相逢
星月不相逢 2020-12-17 21:06

I am working to document a visualization function in a package of mine. For this purpose I would like to have an image embedded through the Rd-file \'funcname.Rd\' that coul

相关标签:
1条回答
  • 2020-12-17 21:14

    Untested, but look at the R source on GitHub, it would appear they add an image to ?par documentation file in the following manner:

     \item{\code{mai}}{A numerical vector of the form \code{c(bottom,
            left, top, right)} which gives the margin size specified in
          inches.\cr
          \if{html}{\figure{mai.png}{options: width="35\%" alt="Figure: mai.png"}}
          \if{latex}{\figure{mai.pdf}{options: width=7cm}}
        }
    

    The figure appears to be saved in /man/figures.

    For more details see the Writing R Extensions section on the topic.

    0 讨论(0)
提交回复
热议问题