在几个包中,最近在github,https://github.com/friendly/matlib上的https://github.com/friendly/matlib包中,我有一个自述的.{md,Rmd}文件,上面写着这样的内容
--一小部分小片段现在可以使用了。使用
browseVignettes("matlib")来查看它们。
我想在自述文件中用一个名和标题的列表来替换或添加这些名字。
在自述文件中,最接近我想要的信息是> vignette(package= "matlib")的结果,如下所示:
Vignettes in package ‘matlib’:
eigen-ex1 Eigenvalues and Eigenvectors: Properties
(source, html)
eigen-ex2 Eigenvalues: Spectral Decomposition (source,
html)
det-ex2 Evaluation of determinants (source, html)
ginv Generalized inverse (source, html)
gramreg Gram-Schmidt Orthogonalization and Regression
(source, html)
inv-ex1 Inverse of a matrix (source, html)
inv-ex2 Matrix inversion by elementary row operations
(source, html)
det-ex1 Properties of determinants (source, html)
linear-equations Solving Linear Equations (source, html)但我想在自述中直接使用的一大块或某些东西来捕捉这一结果。如果我用pkgdown构建软件包站点,我会得到在**文章*下的小片段链接,但我仍然没有任何可以直接使用的小片段名称和标题列表。
发布于 2020-04-07 14:03:51
为了记录在案,tools::getVignetteInfo()给了我我想要的
> vinfo <- tools::getVignetteInfo("ggplot2")
> vinfo
Package Dir Topic
[1,] "ggplot2" "C:/R/R-3.6.3/library/ggplot2" "ggplot2-specs"
[2,] "ggplot2" "C:/R/R-3.6.3/library/ggplot2" "extending-ggplot2"
[3,] "ggplot2" "C:/R/R-3.6.3/library/ggplot2" "ggplot2-in-packages"
File Title
[1,] "ggplot2-specs.Rmd" "Aesthetic specifications"
[2,] "extending-ggplot2.Rmd" "Extending ggplot2"
[3,] "ggplot2-in-packages.Rmd" "Using ggplot2 in packages"
R PDF
[1,] "ggplot2-specs.R" "ggplot2-specs.html"
[2,] "extending-ggplot2.R" "extending-ggplot2.html"
[3,] "ggplot2-in-packages.R" "ggplot2-in-packages.html"
> https://stackoverflow.com/questions/60906060
复制相似问题