相关疑难解决方法(0)

如何将 docx 转换为 PDF?

我想问一下是否可以使用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)

还有其他解决方案吗?

pdf r package text-files shiny

3
推荐指数
2
解决办法
5815
查看次数

标签 统计

package ×1

pdf ×1

r ×1

shiny ×1

text-files ×1