在R包中,我有兩個傳統Sweave短片作爲.Rnw
文件。當我在本地檢查軟件包時(在R Studio中:Build - > Check),沒有錯誤或警告,而且使用R版本3.3.1在R-Forge上檢查軟件包時也會發生同樣的情況。Patched(2016-10 -17 r71531)。R包警告:'vignettes'目錄中的文件比'inst/doc'中的所有文件更新
然而,當我提交包贏得建設者(通過devtools::build_win()
)根據[R devel的檢查(不穩定)(2016年10月16日r71524)),我得到以下警告,我未能解決:
Files in the 'vignettes' directory newer than all files in 'inst/doc':
'fig/plot-Ortho-fm1.pdf', 'fig/plot-Ortho-fm3.pdf',
'fig/plot-grades-can-class.pdf', 'fig/plot-grades-can-gpa.pdf',
'fig/plot-grades-can-sex.pdf', 'fig/plot-grades-pairs.pdf',
'fig/plot-hern-can-age.pdf', 'fig/plot-hern-can-build.pdf',
'fig/plot-hern-can-cardiac.pdf', 'fig/plot-hern-can-pstat.pdf',
'fig/plot-hern-pairs.pdf', 'fig/plot-jury-can1.pdf',
...
我的包目錄結構包括vignettes/
的暈影和在inst/doc/
devtools::build_vignettes()
的結果,如下所示:
...
man/
inst/
doc/HE-examples.{pdf,R,Rnw}
doc/repeated.{pdf,R,Rnw}
R/
vignettes/HE-examples.Rnw
/repeated.Rnw
/fig/ # all generated fig files
我包括所生成的原因在inst/doc/
中有文件,否則我會收到警告,要求.pdf
文件需要用qpdf
進行壓縮,我唯一能做的就是在Acrobat Pro中打開它們並重新保存爲壓縮PDF。
我試過把inst/doc
加到.Rbuildignore
,但是這樣會產生一個錯誤。我也嘗試將inst/doc/*.pdf
添加到.Rbuildignore
,但這沒有效果。
該警告阻止了我向CRAN提交更新。我不明白爲什麼vignettes/
中的新文件應該成爲問題,但我該如何解決警告?
只需一個命令:您可以使用命令'tools :: compactPDF()'來減少您的短片。 –
我試過這個,但由於某種原因,它對PDF文件沒有任何影響,即使我安裝了'qpdf'和'gs'。 – user101089
'vignettes /'中較新的文件是一個問題,因爲'inst/doc'中的文件可能來自某些先前版本的vignette。您可能在小插曲上做了一些工作,但不會向用戶顯示。 – user2554330