用devtools直接安装报错
library(devtools)
devtools::install_github("MRCIEU/TwoSampleMR")
#configure: error: Header file gmp.h not found; maybe use --with-gmp-include=INCLUDE_PATH
#ERROR: configuration failed for package ‘gmp’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/gmp’
#ERROR: dependency ‘gmp’ is not available for package ‘arrangements’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/arrangements’
#ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/lme4’
#ERROR: dependencies ‘gmp’, ‘arrangements’ are not available for package ‘iterpc’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/iterpc’
#ERROR: dependency ‘lme4’ is not available for package ‘meta’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/meta’
#ERROR: dependency ‘iterpc’ is not available for package ‘MendelianRandomization’
#* removing ‘/public/home/wx2022/miniconda3/envs/MR_r4.1.2/lib/R/library/MendelianRandomization’
解决办法
根据报错,依次安装依赖包,不能直接在R中安装的包(可能是因为版本不对)可以用conda安装。
conda install -c conda-forge r-gmp
conda install -c conda-forge r-nloptr
install.packages("arrangements")
install.packages("lme4")
install.packages("iterpc")
install.packages("meta")
install.packages("MendelianRandomization")
安装好依赖包以后就能成功安装TwoSampleMR包了文章来源:https://www.toymoban.com/news/detail-508556.html
devtools::install_github("MRCIEU/TwoSampleMR")
library(TwoSampleMR)
#TwoSampleMR version 0.5.6
#[>] New: Option to use non-European LD reference panels for clumping etc
#[>] Some studies temporarily quarantined to verify effect allele
#[>] See news(package='TwoSampleMR') and https://gwas.mrcieu.ac.uk for further details
library以后显示上面的信息就说明安装成功了文章来源地址https://www.toymoban.com/news/detail-508556.html
到了这里,关于【R包安装】TwoSampleMR 两样本孟德尔随机化的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!