This commit is contained in:
Even Bell 2025-03-21 12:02:27 +00:00
parent 4fba39cdee
commit 1cec12dbb9
4 changed files with 30 additions and 16 deletions

2
.Rprofile Normal file
View File

@ -0,0 +1,2 @@
# R 配置
options("repos" = c(CRAN = "https://mirrors.cernet.edu.cn/CRAN/"))

5
.lintr Normal file
View File

@ -0,0 +1,5 @@
linters: linters_with_defaults(
line_length_linter(120),
object_usage_linter = NULL,
commented_code_linter = NULL
)

21
.vscode/settings.json vendored
View File

@ -1,14 +1,27 @@
/* VSCode */ /* VSCode */
{ {
"r.rpath.linux": ".conda/bin/R", "r.rpath.linux": ".conda/bin/R",
"r.libPaths": [
".conda/bin/R/library"
],
"r.rterm.linux": "${workspaceFolder}/.conda/bin/R", "r.rterm.linux": "${workspaceFolder}/.conda/bin/R",
"r.rterm.option": [ "r.rterm.option": [
"--no-save", "--no-save",
"--no-restore" "--no-restore"
], ],
"r.plot.useHttpgd": true, "r.plot.useHttpgd": true,
"r.libPaths": [ "r.lsp.diagnostics": true,
".conda/bin/R/library" "r.alwaysUseActiveTerminal": true,
], "r.bracketedPaste": true,
"files.eol": "\n" "r.sessionWatcher": true,
"[r]": {
"editor.defaultFormatter": "REditorSupport.r",
"editor.formatOnSave": true
},
"[rmd]": {
"editor.defaultFormatter": "REditorSupport.r",
"editor.formatOnSave": true
},
"files.eol": "\n",
"terminal.integrated.defaultProfile.linux": "R Terminal",
} }

View File

@ -5,7 +5,7 @@
- VSCode 代码编辑器 - VSCode 代码编辑器
VSCode中插件扩展安装 VSCode中插件扩展安装
- Python
- R - R
- R Debugger - R Debugger
@ -24,13 +24,7 @@
1. 初始化conda虚拟环境 1. 初始化conda虚拟环境
创建虚拟环境可以使用VSCode的Python解释器选择功能创建conda虚拟环境创建完虚拟环境后选择对应的虚拟环境使用conda安装对应的R依赖包 `conda create -p .conda -c conda-forge r-base r-languageserver r-devtools r-httpgd radian`
`conda install -c conda-forge r-base r-languageserver r-httpgd r-devtools radian`
或者使用命令创建虚拟环境并同时下载依赖包
`conda create -p .condarc -c conda-forge r-base r-languageserver r-devtools r-httpgd radian`
2. 初始化R Debugger 2. 初始化R Debugger
@ -47,8 +41,8 @@
在当前的conda环境下 在当前的conda环境下
使用`conda search conda-forge::r-包名` 搜索对应的包 使用`conda search -p .conda -c conda-forge r-包名` 搜索对应的包
使用`conda install conda-forge::r-包名` 安装对应的包 使用`conda install -p .conda -c conda-forge r-包名` 安装对应的包
或者采用R通用的安装CRAN 或者采用R通用的安装CRAN