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.
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.
以下操作均是在Windows 10 LTSC 2019環境
安裝radian
- 安裝Minicoda 3(python 3.8支持tensorflow)。
- 根據清華鏡像(https://mirror.tuna.tsinghua.edu.cn/help/anaconda/)提示操作。
- 運行 conda powershell propmt(以下均在此環境)
- 用coda命令管理庫
- 查看已經安裝的庫:coda list
- 安裝庫:coda install 庫名
- 安裝常用的庫
- scipy
conda install scipy
- scipy
- 安裝radian
pip install -U radian
或安裝開發版
pip install -U git+https://github.com/randy3k/radian
運行radianradian
在VScode中用radian替換rterm
ctrl+,
打開設置,左側“擴展->R”然后設置如下:(R安裝在D:\ProgramFiles\ACsoft\R
)
- "Rpath: Windows"設為
D:\ProgramFiles\ACsoft\R\bin\x64\R.exe
- "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
) - "Rterm: Option"去掉
--no-save
和--no-store
- 重新啟動VScode
- 發送R代碼到控制台,Radian出現
- 右側的窗口顯示作圖、幫助等信息(類似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設置