这里我是因为updateR
函数总是失效,不得不采取的方法。
这里我直接是现将新版本4.0 下的library 目录中的包保存出来,接着直接将原本版本R 中的library 直接复制进去,接着再将本来的4.0 下的包(base 之类R 安装中自带的)再覆盖回去。
一切完成后,在新版本的R 中尝试调用安装的其他包:
> library(maftools)
错误: package or namespace load failed for ‘maftools’:
package ‘maftools’ was installed before R 4.0.0: please re-install it
报错了,提示说是版本不对。
这时候直接对目录中的 R 包进行更新:
update.packages(checkBuilt=TRUE, ask = T)
接着就在后台放一阵吧~
但有时候基础包的更新函数却对Bioconductor和Github 上的包更新不是那么友好了:
> library(hgu133plus2.db )
载入需要的程辑包:AnnotationDbi
载入需要的程辑包:stats4
载入需要的程辑包:BiocGenerics
载入需要的程辑包:parallel
Error: package or namespace load failed for ‘BiocGenerics’:
package ‘BiocGenerics’ was installed before R 4.0.0: please re-install it
错误: 无法载入程辑包‘BiocGenerics’
像有些包还是会出问题。
我们还需要更新一下bioconductor 上面的包:
BiocManager::install(version = '3.12') # 对应R4.0 版本
The downloaded binary packages are in
/var/folders/sk/14xz_vl55jz8jcjm8lj1zdd00000gn/T//Rtmpq6nwTk/downloaded_packages
Installing package(s) 'airway', 'annotate', 'AnnotationDbi',
'AnnotationFilter', 'AnnotationHub', 'Biobase', 'BiocFileCache',
'BiocGenerics', 'BiocParallel', 'BiocStyle', 'BiocVersion', 'biomaRt',
'Biostrings', 'biovizBase', 'BSgenome', 'BSgenome.Hsapiens.UCSC.hg19',
'BSgenome.Hsapiens.UCSC.hg38', 'clusterProfiler', 'DelayedArray', 'DOSE',
'enrichplot', 'ensembldb', 'exomeCopy', 'fgsea', 'geneplotter',
'GenomeInfoDb', 'GenomeInfoDbData', 'GenomicAlignments', 'GenomicFeatures',
'GenomicRanges', 'GEOquery', 'ggbio', 'GO.db', 'GOSemSim', 'graph',
'GSEABase', 'GSVA', 'Gviz', 'impute', 'InteractionSet',
'interactiveDisplayBase', 'IRanges', 'KEGG.db', 'limma', 'maftools',
'org.Hs.eg.db', 'OrganismDbi', 'pcaMethods', 'preprocessCore', 'processx',
'ProtGenerics', 'qvalue', 'RBGL', 'Rgraphviz', 'Rhtslib', 'Rsamtools',
'rtracklayer', 'S4Vectors', 'SomaticCancerAlterations', 'SomaticSignatures',
'spatstat', 'SummarizedExperiment', 'trackViewer', 'VariantAnnotation',
'XVector', 'zlibbioc'
also installing the dependencies ‘downloader’, ‘MatrixGenerics’, ‘scatterpie’, ‘shadowtext’
可以尝试一下Y 叔叔写的rvcheck::update_all()
参见:https://cran.r-project.org/web/packages/rvcheck/
> rvcheck::update_all()
upgrading CRAN packages...
There are binary versions available but the source versions are later:
binary source needs_compilation
processx 3.5.0 3.5.1 TRUE
spatstat 2.0-1 2.1-0 TRUE
装R4.0 的包内容又渐渐鼓起来啦~