我想问一下是否可以使用R将文本文件(例如word文档或文本文档)转换为PDF?我想使用此代码将其转换为 .rmd,然后转换为 PDF
require(rmarkdown)
my_text <- readLines("C:/.../track.txt")
cat(my_text, sep=" \n", file = "my_text.Rmd")
render("my_text.Rmd", pdf_document())
Run Code Online (Sandbox Code Playgroud)
但它不起作用显示此错误:
> Error: Failed to compile my_text.tex.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "my_text.tex"' had status 127
Run Code Online (Sandbox Code Playgroud)
还有其他解决方案吗?