简体   繁体   English

链接R包装晕影

[英]Linking R package vignettes

Is there any way I can include links between package vignettes in R ? 有没有什么办法可以在R中的包装小插图之间加入链接? I know I can link between section, for example 例如,我知道我可以在部分之间进行链接

# Section 1 {#section1}
My first section

# Section 2
A link to [Section 1](#section1)

But is there any way I can get a clickable link that will launch the HTML doucment of another vignette? 但有什么方法可以获得一个可点击的链接,将启动另一个小插图的HTML doucment? Or is it just easier to give the code to launch it? 或者让代码启动它更容易?

```r
vignette("my vignette", package = "myPackage")
```

Note I have generated all of my vignettes using Rmarkdown and knitr . 注意我使用Rmarkdownknitr生成了所有的小插曲。

Yes, this is simple. 是的,这很简单。 Vignettes are all stored in the same directory, so you simply refer to the appropriate file name. Vignettes都存储在同一目录中,因此您只需引用相应的文件名即可。 The drat package vignettes have several examples of this. drat包装小插曲有几个例子。 Here is a link from one vignette to the other: 这是从一个小插图到另一个小插图的链接:

This vignette deals with the first case: How to use
[drat](http://dirk.eddelbuettel.com/code/drat.html) as a package author.  A
[companion vignette for package users](DratForPackageUsers.html) is available as well.

This will work on CRAN and on a user's machine. 这将适用于CRAN和用户的计算机。

You should also be able to link from vignettes to documentation, and vice versa, on a user's machine, knowing that vignettes are stored in library/PKGNAME/doc/ and documentation is stored in: library/PKGNAME/html/ . 您还应该能够在用户的计算机上从小插图链接到文档,反之亦然,知道小插图存储在library/PKGNAME/doc/ ,文档存储在: library/PKGNAME/html/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM