a.配置conda镜像源
vim ~/.condrc
#将下列镜像直接粘贴进去就好,https -> http
channels:
- defaults
show_channel_urls: true
default_channels:
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
b. 创建虚拟环境
conda create -n R
source activate R
c. 安装r-4.0 #安装好的r4.0.5有时候打开会变成r3.6.1,我们需要删除原本的R。
conda install -c conda-forge r-base=4.0
2. 安装R包
点击查看代码
a. 修改镜像源文件
file.edit('~/.Rprofile')
#直接粘贴options(repos='http://cran.rstudio.com/')
options("repos" = c(CRAN="http://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
options(repos=structure(c(CRAN="http://mirrors.tuna.tsinghua.edu.cn/CRAN/")))
b. 安装并运行IRkernel
install.packages('IRkernel')
IRkernel::installspec()
c. 安装Seurat
install.packages('Seurat')
# 报错:Installing the R-package "rgeos" on linux: geos-config not found or not executable# 更新python到3.7;# conda install r-rgeos,成功了!!!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具