我正在创建一个带有小插图的 R 包。但是,当我尝试使用
devtools::install(build_vignettes = TRUE)
由于在 doc 文件夹中找不到文件 index.html,因此发生错误。我以为这个文件会自动创建,但显然这里出了点问题。发生的错误如下:
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore \
--quiet CMD INSTALL "C:/Users/lnab/AppData/Local/Temp/Rtmpi0XLJ4/mecor_0.1.0.tar.gz" \
--library="\\vf-d2-home/d2home$/lnab/MyDocs/R/win-library/3.4" --install-tests
* installing *source* package 'mecor' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
converting help for package 'mecor'
finding HTML links ... done
mecor-package html
uaetrial html
uaetrial_cal html
** building package indices
** installing vignettes
Warning in file(con, "w") :
cannot open file '\\vf-d2-home/d2home$/lnab/MyDocs/R/win-library/3.4/mecor/doc/index.html': No such file or directory
Error in file(con, "w") : cannot open the connection
ERROR: installing vignettes failed
* removing '\\vf-d2-home/d2home$/lnab/MyDocs/R/win-library/3.4/mecor'
* restoring previous '\\vf-d2-home/d2home$/lnab/MyDocs/R/win-library/3.4/mecor'
In R CMD INSTALL
我的小插图 .Rmd 看起来像这样:
---
title: "Introduction to mecor"
author: "Linda Nab"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Introduction to mecor}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
我以前从未构建过 R 包,但在互联网上搜索了几天的解决方案,但找不到任何解决方案。这似乎是同一个问题,但我在那里找不到问题的解决方案。你可以在这里找到我的包裹。
真的希望有人能帮助我!