在更新了R和RStudio以及所有包之后,我正在尝试呈现和旧的rmarkdown文件,但是我得到了:
Error: pandoc document conversion failed with error 99然而,这条路是正确的。我昨天已经呈现给HTML了,一切都很好。
```{r, echo=FALSE, fig.cap="", out.width = '50%', fig.align='center'}knitr::include_graphics("/img/posts/que-es-un-api/mastercard-blockchain-api.jpg")

它说到图像的路径是错误的,但希望您可以从图像路径是正确的。
"C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS que-es-un-api.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output que-es-un-api.html --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\OGONZALES\Documents\R\win-library\3.6\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "C:\Users\OGONZA~1\AppData\Local\Temp\RtmpSsSNeA\rmarkdown-str1340bc36ef.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
File /img/posts/que-es-un-api/mastercard-blockchain-api.jpg not found in resource path
Error: pandoc document conversion failed with error 99
Execution halted我甚至尝试用以下方法重新安装Pandoc:
# installing/loading the package:
if(!require(installr)) { install.packages("installr"); require(installr)} #load / install+load installr
# Installing pandoc
install.pandoc()sessionInfo:
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.1 htmltools_0.3.6 tools_3.6.1 yaml_2.2.0 Rcpp_1.0.2
[6] rmarkdown_1.14 knitr_1.24 xfun_0.8 digest_0.6.20 evaluate_0.14 发布于 2019-08-18 20:48:26
也许工作目录被更改了。试着包括整个路径:
```{r, echo=FALSE, fig.cap="", out.width = '50%', fig.align='center'}knitr::include_graphics("D:/omargonzalesdiaz/static/img/posts/que-es-un-api/mastercard-blockchain-api.jpg")
发布于 2022-02-09 17:56:24
我们讨论了这里和这里这两个问题,它们本身并不是一个bug。对我有效的解决办法是使用:
```{r example, echo = FALSE, out.width='80%', out.height='50%'}knitr::include_graphics(paste0(getwd(),“/映像/示例_Image.png”))
如果您在Rstudio项目中工作,那么首先指定目录将有所帮助:
```{r example, echo = FALSE, out.width='80%', out.height='50%'}Rprojroot::find_rstudio_root_file()
knitr::include_graphics(paste0(getwd(),“/映像/示例_Image.png”))
https://stackoverflow.com/questions/57520181
复制相似问题