gpt4 book ai didi

r - 如何在 VS 代码中使用带有 R 内核的 jupyter notebook?

转载 作者:行者123 更新时间:2023-12-04 11:36:19 24 4
gpt4 key购买 nike

现在我可以在 Web 浏览器中使用带有 R 内核的 jupyter lab,并使用 VS Code 使用 python 内核编辑 jupyter 笔记本代码,是否可以使用 jupyter notebook 模式在 VS Code 中编辑 R 代码?感谢您的评论和解决方案。

最佳答案

对的,这是可能的。您只需要安装 IRkernel (R内核)第一。
根据文档,运行两行

install.packages('IRkernel')
IRkernel::installspec() # to register the kernel in the current R installation
然后,重新启动您的 VSCode 并:
  • 键入 Ctrl + Shift + P 以搜索“Jupyter:创建新的空白笔记本”
    enter image description here
  • 点击右上角省略号右下方的按钮选择内核
    enter image description here
  • 切换到所需的内核,在本例中为 R 的 enter image description here

  • 就是这样!

    关于r - 如何在 VS 代码中使用带有 R 内核的 jupyter notebook?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61540700/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com