將VScdoe的R終端替換為radian


Miniconda介紹

Miniconda is a free minimal installer for conda. It is a small, bootstrap version of Anaconda that includes only conda, Python, the packages they depend on, and a small number of other useful packages, including pip, zlib and a few others.

Miniconda 主頁
Miniconda 歷史版本

radian介紹

radian is an alternative console for the R program with multiline editing and rich syntax highlight. One would consider radian as a ipython clone for R, though its design is more aligned to julia.

radian主頁

以下操作均是在Windows 10 LTSC 2019環境

安裝radian

  1. 安裝Minicoda 3(python 3.8支持tensorflow)。
  2. 根據清華鏡像(https://mirror.tuna.tsinghua.edu.cn/help/anaconda/)提示操作。
  3. 運行 conda powershell propmt(以下均在此環境)
  4. 用coda命令管理庫
    • 查看已經安裝的庫:coda list
    • 安裝庫:coda install 庫名
  5. 安裝常用的庫
    • scipy conda install scipy
  6. 安裝radian
    pip install -U radian
    或安裝開發版
    pip install -U git+https://github.com/randy3k/radian
    運行radian radian

在VScode中用radian替換rterm

ctrl+,打開設置,左側“擴展->R”然后設置如下:(R安裝在D:\ProgramFiles\ACsoft\R)

  1. "Rpath: Windows"設為D:\ProgramFiles\ACsoft\R\bin\x64\R.exe
  2. "Rterm: Windows"中將默認的rterm(D:\ProgramFiles\ACsoft\R\bin\x64\R.exe)替換為radian.exe的路徑D:\ProgramFiles\Coding\Miniconda3\Scripts\radian.exe。(Minicoda安裝在D:\ProgramFiles\Coding\Miniconda3)
  3. "Rterm: Option"去掉--no-save--no-store
  4. 重新啟動VScode
  5. 發送R代碼到控制台,Radian出現
  6. 右側的窗口顯示作圖、幫助等信息(類似Rstudio的界面)

上面設置在setting.json中如下:

    "r.rterm.windows": "D:\\ProgramFiles\\Coding\\Miniconda3\\Scripts\\radian.exe",
    "r.rpath.windows": "D:\\ProgramFiles\\ACsoft\\R\\bin\\x64\\R.exe",
    "r.lsp.debug": true,
    "r.bracketedPaste": true,   //使用radian設置
    "r.sessionWatcher": true,   //使用radian設置
    "r.rterm.option": [],       //使用radian設置


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM