R包c(diǎn)lusterProfiler如何安裝成功(新手必看!)
前言
里面有些坑,寫篇博客介紹一下。
R包clusterProfiler是生物信息分析匯總,基因富集分析可視化經(jīng)常用到的R包,但是安裝時,新手經(jīng)常會遇到一些問題,這里簡單總結(jié)一下。
看重點(diǎn):正確的安裝方式
官網(wǎng):https://bioconductor.org/packages/release/bioc/html/clusterProfiler.html
在R中運(yùn)行下面命令,安裝即可:
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("clusterProfiler")
1. 在CRAN中用install.packages()安裝
install.packages("clusterProfile")
安裝報(bào)錯:
> install.packages("clusterProfile")
(因?yàn)椤甽ib'沒有被指定)
Warning in install.packages :
package ‘clusterProfile' is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
>
報(bào)錯原因,因?yàn)?code>clusterProfile不在CRAN中,所以不能通過install.packages進(jìn)行安裝。
2. 安裝bioconductor報(bào)錯
有時候,知道在bioconductor中,于是還是安裝:
install.packages("bioconductor")
報(bào)錯如下:
> install.packages("bioconductor")
(因?yàn)椤甽ib'沒有被指定)
Warning in install.packages :
package ‘bioconductor' is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
3. 正確而順利的安裝方法
3.1 安裝最新版R
目前是4.2.1,因?yàn)镽4.2之前的clusterProfiler有bug,kegg聯(lián)網(wǎng)會報(bào)錯,新版本沒有問題了。
3.2 安裝Rtools4.2
這是單機(jī)軟件,地址:https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html
3.3 配置鏡像
在Rstudio中,將下載鏡像變?yōu)橹袊?,下載速度會快很多。


3.4 正式安裝
在Rstudio中運(yùn)行安裝代碼:
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("clusterProfiler")
這中間會安裝許多依賴包,如果有某個包安裝報(bào)錯了,就單獨(dú)安裝那個包,安裝成功后,在運(yùn)行安裝clusterProfiler的代碼。
4. 配置建議
- R最新版的R4.2.1
- 安裝Rtools(windows系統(tǒng)建議)
- 安裝路徑不要有中文路徑
- 如果電腦用戶名是中文的,建議新建一個英文用戶名,然后登錄安裝
- 配置鏡像,提升安裝速度
總結(jié)
到此這篇關(guān)于R包c(diǎn)lusterProfiler如何安裝成功的文章就介紹到這了,更多相關(guān)R包c(diǎn)lusterProfiler安裝成功內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
R語言學(xué)習(xí)ggplot2繪制統(tǒng)計(jì)圖形包全面詳解
這篇文章主要為大家詳細(xì)介紹了R語言學(xué)習(xí)ggplot2繪制統(tǒng)計(jì)圖形包的全面知識講解,有需要的朋友可以借鑒參考下,希望能夠有所幫助2021-11-11

