r在win10上没有附加在VS代码中
我最近从rstudio切换到VS代码。我已经在VS代码中安装了R扩展名,但是当我打开VS代码和R终端时,R会加载R。我遵循CoIP的方法,但仍然无法加载R:
################################################ ###################################### 我遵循了Coip的建议,R被成功激活。在我的另一台笔记本电脑(Win)中,可以无需任何问题即可激活R。但是,当我检查settings.json
文件时,没有r.rterm.windows
的规范。 我想问一下为什么我的笔记本电脑可以在VS代码中成功加载r,而不必包括COIP建议的那些代码段
?
{
"workbench.colorTheme": "Default Dark+",
"python.formatting.provider": "yapf",
"security.workspace.trust.untrustedFiles": "open",
"python.defaultInterpreterPath": "C:\\Users\\Patrick Wen\\AppData\\Local\\Programs\\Python\\Python310\\python.exe",
"terminal.integrated.enableMultiLinePasteWarning": false,
"files.associations": {
"*.rmd": "markdown"
}
}
I am recently switching from RStudio to VS Code. I have installed R extension in VS Code, but when I open VS Code and R terminal, R cannot be loaded. I followed coip's method but still cannot get R loaded:
##############################################################################
I followed coip's suggstion and R is successfully activated. In another of my laptop (Win), R could be activated without any issue. But when I check the settings.json
file, there is no such specification as r.rterm.windows
. I want to ask why my laptop could successfuly load R in VS Code without having to include those code snippet suggested by coip?
Below is the settings.json
in my laptop:
{
"workbench.colorTheme": "Default Dark+",
"python.formatting.provider": "yapf",
"security.workspace.trust.untrustedFiles": "open",
"python.defaultInterpreterPath": "C:\\Users\\Patrick Wen\\AppData\\Local\\Programs\\Python\\Python310\\python.exe",
"terminal.integrated.enableMultiLinePasteWarning": false,
"files.associations": {
"*.rmd": "markdown"
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这是您的完整
settings.json
,则缺少常见参数,例如r.rpath.windows
和- r-binary
在r.rterm.option
下。我相信添加这些,与当前有关r.rpath.windows
的R的路径相同,应该解决您的问题。这是一个典型的设置,您可以将其复制并粘贴到JSON设置中,您可以通过View>命令调色板>首选项:打开设置(JSON):
注意:其中一些只是首选项(例如
R.BracketedPaste
)。因此,您可以尝试添加上述所有或以上某些内容,保存JSON设置,然后重新启动VSCODE,直到解决问题为止。
如果这不起作用,让我们尝试通过将以下内容添加到您的
settings.json
:您也可以尝试通过上面添加以下以下行来制作R:
If that is your complete
settings.json
, you're missing common parameters such asr.rpath.windows
and the--r-binary
underr.rterm.option
. I believe adding those, with the same path to R that you currently have forr.rpath.windows
should fix your issue.Here is a typical setup that you can copy and paste into your JSON settings, which you can access via View > Command Palette > Preferences: Open Settings (JSON):
Note: some of those are just preferences (e.g.
r.bracketedPaste
).So you can try to add all of the above or some of the above, save your JSON settings, and relaunch VSCode, until the problem is fixed.
If that doesn't work, let's try setting up an integrated profile, by adding the following to your
settings.json
:You can also try making R your default terminal by adding the following line above too: