无法编织 Rmd 文件,因为我更改了用户目录的名称

Cannot knit Rmd file since I changed the name of User directory

我在 RStudio 上使用 R for windows。 我最近因为某种原因更改了用户目录的名称,似乎更改导致编织 Rmd 文件出现问题。

如果我尝试编写 Rmd 文件,会出现以下错误信息:

Error: invalid version specification 'find' In addition: Warning message: In system(paste(shQuote(path), "--version"), intern = TRUE) : running command '"C:/PROGRA~3/CHOCOL~1/bin/pandoc.exe" --version' had status 65535 Execution halted

我在cmd中输入了'"C:/PROGRA~3/CHOCOL~1/bin/pandoc.exe" --version',它说

Cannot find file at 'c:\users\MY OLD USER NAME\appdata\local\pandoc\pandoc.exe'

所以,我猜 knitr 或 pandoc 试图找到错误的路径。 我该如何解决这个问题?如何更改路径?

这是我尝试过的列表:

看来你是通过Chocolatey自己安装的Pandoc,更改用户目录名称后安装失败。

首先,you do not have to install Pandoc separately if you are using RStudio,因为 RStudio 已经捆绑了 Pandoc。

如果您出于某种原因必须安装 Pandoc,您可能需要重新安装它(也许您也必须重新安装 Chocolatey)。

choco uninstall pandoc
choco install pandoc