Rstudio 孟德尔随机化代码报错,extract_instruments函数报错Error in if (nrow(d) == 0) return(NULL) : 参数长度为零
install.packages("remotes")
remotes::install_github("MRCIEU/TwoSampleMR")
library(TwoSampleMR)
ao <- available_outcomes()#下载所有GWAS数据
write.csv(ao,"ao_2024.4.17.csv")
bacteria <- ao[grep("Gut microbiota abundance",ao$trait),]#提取trait分类为Gut microbiota abundance的行
head(bacteria)
results <- extract_instruments(outcomes = bacteria$id, p1=1e-5, clump = T)
Error in if (nrow(d) == 0) return(NULL) : 参数长度为零