这里我是因为updateR 函数总是失效,不得不采取的方法。

    这里我直接是现将新版本4.0 下的library 目录中的包保存出来,接着直接将原本版本R 中的library 直接复制进去,接着再将本来的4.0 下的包(base 之类R 安装中自带的)再覆盖回去。

    一切完成后,在新版本的R 中尝试调用安装的其他包:

    1. > library(maftools)
    2. 错误: package or namespace load failed for maftools’:
    3. package maftools was installed before R 4.0.0: please re-install it

    报错了,提示说是版本不对。

    这时候直接对目录中的 R 包进行更新:

    1. update.packages(checkBuilt=TRUE, ask = T)

    接着就在后台放一阵吧~

    但有时候基础包的更新函数却对Bioconductor和Github 上的包更新不是那么友好了:

    1. > library(hgu133plus2.db )
    2. 载入需要的程辑包:AnnotationDbi
    3. 载入需要的程辑包:stats4
    4. 载入需要的程辑包:BiocGenerics
    5. 载入需要的程辑包:parallel
    6. Error: package or namespace load failed for BiocGenerics’:
    7. package BiocGenerics was installed before R 4.0.0: please re-install it
    8. 错误: 无法载入程辑包‘BiocGenerics

    像有些包还是会出问题。

    我们还需要更新一下bioconductor 上面的包:

    1. BiocManager::install(version = '3.12') # 对应R4.0 版本
    2. The downloaded binary packages are in
    3. /var/folders/sk/14xz_vl55jz8jcjm8lj1zdd00000gn/T//Rtmpq6nwTk/downloaded_packages
    4. Installing package(s) 'airway', 'annotate', 'AnnotationDbi',
    5. 'AnnotationFilter', 'AnnotationHub', 'Biobase', 'BiocFileCache',
    6. 'BiocGenerics', 'BiocParallel', 'BiocStyle', 'BiocVersion', 'biomaRt',
    7. 'Biostrings', 'biovizBase', 'BSgenome', 'BSgenome.Hsapiens.UCSC.hg19',
    8. 'BSgenome.Hsapiens.UCSC.hg38', 'clusterProfiler', 'DelayedArray', 'DOSE',
    9. 'enrichplot', 'ensembldb', 'exomeCopy', 'fgsea', 'geneplotter',
    10. 'GenomeInfoDb', 'GenomeInfoDbData', 'GenomicAlignments', 'GenomicFeatures',
    11. 'GenomicRanges', 'GEOquery', 'ggbio', 'GO.db', 'GOSemSim', 'graph',
    12. 'GSEABase', 'GSVA', 'Gviz', 'impute', 'InteractionSet',
    13. 'interactiveDisplayBase', 'IRanges', 'KEGG.db', 'limma', 'maftools',
    14. 'org.Hs.eg.db', 'OrganismDbi', 'pcaMethods', 'preprocessCore', 'processx',
    15. 'ProtGenerics', 'qvalue', 'RBGL', 'Rgraphviz', 'Rhtslib', 'Rsamtools',
    16. 'rtracklayer', 'S4Vectors', 'SomaticCancerAlterations', 'SomaticSignatures',
    17. 'spatstat', 'SummarizedExperiment', 'trackViewer', 'VariantAnnotation',
    18. 'XVector', 'zlibbioc'
    19. also installing the dependencies downloader’, MatrixGenerics’, scatterpie’, shadowtext

    可以尝试一下Y 叔叔写的rvcheck::update_all()

    参见:https://cran.r-project.org/web/packages/rvcheck/

    1. > rvcheck::update_all()
    2. upgrading CRAN packages...
    3. There are binary versions available but the source versions are later:
    4. binary source needs_compilation
    5. processx 3.5.0 3.5.1 TRUE
    6. spatstat 2.0-1 2.1-0 TRUE

    装R4.0 的包内容又渐渐鼓起来啦~

    18. mac os R包新旧版本的迁移问题 - 图1