实际在其中的浏览小插图找不到任何小插图 [英] No vignettes found by browseVignettes where they actually are there

查看:111
本文介绍了实际在其中的浏览小插图找不到任何小插图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在github存储库上有一个,在中有2个小插曲vignettes / 目录。

I have a package on a github repository with 2 vignettes in the vignettes/ directory.

如果尝试使用 devtools 这样的软件包,我尝试下载

I tried to download if with devtools package like this

> if (!require(devtools)) {
+     install.packages("devtools")
+     require(devtools)
+ }
> install_github("MarcinKosinski/RTCGA", build_vignettes=TRUE)
Downloading github repo MarcinKosinski/RTCGA@master
Installing RTCGA
"D:/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore CMD INSTALL  \
  "C:/Users/Marcin/AppData/Local/Temp/Rtmpg1Kbfy/devtools3cf47f1f6731/MarcinKosinski-RTCGA-0d91d7c"  \
  --library="C:/Users/Marcin/Documents/R/win-library/3.2" --install-tests 

* installing *source* package 'RTCGA' ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (RTCGA)
Reloading installed RTCGA
Welcome to the RTCGA (version: 0.99.6).

但是当我尝试浏览Vignettes时,似乎并没有构建它们。

but when I try to browse Vignettes it appears they were not build.

> library(RTCGA)
> browseVignettes("RTCGA")
No vignettes found by browseVignettes("RTCGA")

I未找到小插图已经看过一些旧问题人们建议使用 build_vignettes = TRUE ,但是如您所见, OR 添加移动小插图以删除 inst / doc / .Rbuildignore 文件中的c>目录。但这肯定是老问题了,因为安装软件包后,我在二进制源文件中还没有看到过这样的目录。

I've seen some old issue where people suggested to use build_vignettes=TRUE, but as you see it didn't help OR to add move Vignettes to remove inst/doc/ directory from .Rbuildignore file. But this must be and old issue, because I haven't seen such directory in a binary source after installation of the package.

我也看到过关于类似问题的答案,但是当我构建源代码然后从源代码安装软件包时,它似乎也存在相同的问题: browserVignettes( RTCGA)没有发现短片。

I've also seen this answer on a similar question, but when I built source and then install package from a source it appears to have the same issue: No vignettes found by browseVignettes("RTCGA").

有任何想法可以使这项工作吗?

Any idea on how to make this work?

编辑

根据Martin的回答
我已将此代码片段添加到小插图中'YAML

According to Martin's answer I've addedthis fragment of code to vignettes' YAML

vignette: >
  %\VignetteIndexEntry{Integrating TCGA Data - RTCGA Tutorial}
  %\VignetteEngine{knitr::rmarkdown}

我已经编辑了2个小插曲的YAML

I've edited YAML of 2 of my vignettes


  • 我已将代码添加到YAML-此文件

  • 以防万一我曾在YAML的末尾添加新信息-此文件

  • I've added code to the beggining of YAML - this file
  • Just in case I once added new information to the end of YAML - this file

,但是从github安装后似乎仍然没有可用的小插曲

but still there appears there are no vignettes available after installation from github

    > devtools::install_github("MarcinKosinski/RTCGA")
    Downloading github repo MarcinKosinski/RTCGA@master
    Installing RTCGA
    '/usr/lib/R/bin/R' --vanilla CMD INSTALL  \
      '/tmp/Rtmpk34Zbr/devtools531845716f54/MarcinKosinski-RTCGA-5571117'  \
      --library='/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2' --install-tests 

    * installing *source* package ‘RTCGA’ ...
    ** R
    ** tests
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded
    * DONE (RTCGA)
    > library(RTCGA)
    Welcome to the RTCGA (version: 0.99.6).
    > browseVignettes("RTCGA")
    No vignettes found by browseVignettes("RTCGA")

编辑2

当然我已经放弃添加参数 buildVignettes = TRUE ,但是之后看起来好像有小插图,但是在构建过程中它们的编译存在一些问题:

Of course I've forgoten to add parameter buildVignettes = TRUE but after this it looks like vignettes are seen but there is some problem with their compilation during build:

devtools::install_github("MarcinKosinski/RTCGA", build_vignettes=TRUE)
Downloading github repo MarcinKosinski/RTCGA@master
Installing RTCGA
'/usr/lib/R/bin/R' --vanilla CMD build  \
  '/tmp/RtmpA7il1Q/devtools5fc871b48f57/MarcinKosinski-RTCGA-e47bdf6'  \
  --no-resave-data --no-manual 

* checking for file ‘/tmp/RtmpA7il1Q/devtools5fc871b48f57/MarcinKosinski-RTCGA-e47bdf6/DESCRIPTION’ ... OK
* preparing ‘RTCGA’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
Removed empty directory ‘RTCGA/ghPage’
Removed empty directory ‘RTCGA/inst’
* building ‘RTCGA_0.99.6.tar.gz’

'/usr/lib/R/bin/R' --vanilla CMD INSTALL  \
  '/tmp/RtmpA7il1Q/RTCGA_0.99.6.tar.gz'  \
  --library='/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2'  \
  --install-tests 

* installing *source* package ‘RTCGA’ ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
Warning in file(con, "w") :
  cannot open file '/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2/RTCGA/doc/index.html': No such file or directory
Error in file(con, "w") : cannot open the connection
ERROR: installing vignettes failed
* removing ‘/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2/RTCGA’
* restoring previous ‘/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2/RTCGA’
Error: Command failed (1)


推荐答案

从编写R扩展的 1.4.2 ,您的小插曲需要有一行

From Writing R Extensions, section 1.4.2, your vignettes need to have a line

%\VignetteEngine{knitr::knitr}

;常见的范例是在小插图顶部的Yaml中添加以下内容

in them; a common paradigm is to add the following to the yaml at the top of the vignette

vignette: >
  %\VignetteIndexEntry{Integrating TCGA Data}
  %\VignetteEngine{knitr::rmarkdown}

VignetteIndexEntry为R的帮助系统提供了一个方便的标题。请记住 BiocStyle 包,用于创建外观一致的小插曲。

VignetteIndexEntry provides a convenient title for R's help system. Remember the BiocStyle package for creating vignettes with a consistent look.

这篇关于实际在其中的浏览小插图找不到任何小插图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆