Visual Studio Code - R 语言服务器

问题描述 投票:0回答:2

我习惯使用RStudio。然而,最近我遇到了 Visual Studio Code,并成功将其安装在我的电脑上。我遵循了任坤文章的所有描述:

https://renkun.me/2019/12/11/writing-r-in-vscode-a-fresh-start/

但是,当我启动 VS Code 时,我收到以下错误消息:

R语言服务器(5016)启动 错误:在以“C:\U”开头的字符串中使用了“\U”,但没有使用十六进制数字 执行停止 R 语言服务器 (5016) 退出,退出代码为 1

我的settings.json 看起来像这样:

{
    "r.bracketedPaste": true,
    "r.rterm.windows": "C:\\Users\\AppData\\Roaming\\Python\\Python39\\Scripts\\radian.exe",
    "r.rpath.windows": "C:\\Program Files\\R\\R-4.0.5\\bin\\x64\\R.exe",
    "r.lsp.debug": true,
    "r.lsp.diagnostics": true,
    "r.sessionWatcher": true,
    "r.rterm.option": [
        "--no-save",
        "--no-restore",
        "--r-binary=C:\\Program Files\\R\\R-4.0.5\\bin\\x64\\R.exe"
    ],
}

提前非常感谢您的帮助!

问候, 亨利

r visual-studio-code
2个回答
0
投票

找到您的

.Rprofile
文件。那里应该有一行:

options(langserver_library = '<path to>\languageserver-library')

将反斜杠更改为正斜杠,然后重新启动 VS Code 和 R。


0
投票

在 Windows 中哪里可以找到 .Rprofile?

© www.soinside.com 2019 - 2023. All rights reserved.