LoginSignup
0
0

More than 1 year has passed since last update.

Rのメジャーアップデートに伴うライブラリ再インストール

Posted at

目的

プロジェクトのキリの良いところでRのバージョンを3.5.2から最新版(4.2)へのアップデートを試みた.
メジャーアップデートをするとライブラリを再度インストールする必要があるため,
次回のメジャーアップデートに備えて今回の記録を残しておく.

概要

Bioconductorをインストール
前バージョンのライブラリ名の配列を取得
上記ライブラリ群のインストールをCRAN→Bioconductor→devtoolsの順に試す

環境

iMac Pro (2017)
MacOS Big Sur 11.6.5

Rのインストール

https://cran.r-project.org/bin/macosx/
より4.2.0をダウンロード開始.しかしダウンロードが遅すぎたのでミラーサイト
https://cran.ism.ac.jp
からpkgファイルをダウンロードし,インストール

XQuarts

バージョンを確認したところ最新版であったため,再インストールなどは行わず

Bioconductorのインストール

Rを起動し,バージョンが4.2であることを確認.
Bioconductorのウェブサイトの記載通りにインストール
https://www.bioconductor.org/install/

if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install(version = "3.15")

ライブラリのアップデート

CRAN経由

3.5.2にインストールされている全ライブラリ名を参照し,install.packages()でまるごとインストールを試みる.

libnames35 <- list.files(path = "/Library/Frameworks/R.framework/Versions/3.5/Resources/library")
install.packages(libnames35)

Bioconductor経由

install.packages()で入らなかったライブラリをBiocManager::install()でインストールを試みる.

libnames42 <- list.files(path = "/Library/Frameworks/R.framework/Versions/4.2/Resources/library")
not.installed <- setdiff(libnames35, libnames42)
BiocManager::install(not.installed)

devtools経由

BiocManager::install()でもインストールされなかったライブラリを再び確認し,必要なもののみdevtools::install_github()で入れる.

libnames42 <- list.files(path = "/Library/Frameworks/R.framework/Versions/4.2/Resources/library")
not.installed <- setdiff(libnames35, libnames42)
not.installed

[1] "BiocInstaller" "DNB"           "garnett"       "ggbiplot"      "monocle3"      "pforeach"      "SDMTools"

library("devtools")
devtools::install_github("vqv/ggbiplot")
devtools::install_github('cole-trapnell-lab/leidenbase')
devtools::install_github("cole-trapnell-lab/garnett")
devtools::install_github('cole-trapnell-lab/monocle3')
# package ‘batchelor’ is not available for this version of Rというエラーが出たのでインストール
BiocManager::install("batchelor")
devtools::install_github('cole-trapnell-lab/monocle3')
devtools::install_github("hoxo-m/pforeach")

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0