尝试在本地计算机上构建此gitbook时遇到以下错误(试图将其用作创建自己的工作的模板):
https://github.com/lgatto/IntroMachineLearningWithR
错误:
Error in x[i] <- sprintf("<a href=\"%s#%s\"", filenames[which.max(lines[lines <= :
replacement has length zero
Calls: <Anonymous> ... <Anonymous> -> split_chapters -> restore_links -> lapply -> FUN
还会出现以下警告,但这对修复任务的重要性可能较小:
In addition: Warning message:
In split_chapters(output, gitbook_page, number_sections, split_by, :
You have 6 Rmd input file(s) but only 5 first-level heading(s). Did you forget first-level headings in certain Rmd files?
会话信息:
sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.1 backports_1.1.2 bookdown_0.7 rsconnect_0.8.8 rprojroot_1.3-2 htmltools_0.3.6
[7] tools_3.5.1 yaml_2.2.0 Rcpp_0.12.19 rmarkdown_1.10 knitr_1.20 xfun_0.4
[13] digest_0.6.18 evaluate_0.12
答案 0 :(得分:0)
我对此游戏很晚,但是请确保您要编织的.rmd文件中的第一级标题为headers.Select((name, index) => new { name, index })
.AsParallel()
.ForAll
(
header =>
{
switch (header.name)
{
case "First":
firstColumn = header.index;
break;
case "Second":
secondColumn = header.index;
break;
}
}
);
,而不是#
或{{1 }} 等等。我遇到了同样的错误,这为我解决了。