RISmed軟體包的使用(碰到EUtilsGet()步驟報錯,暫未解決)

corrschi發表於2024-03-16

教程1:https://www.jianshu.com/p/1544070a95e1
教程2:https://www.jingege.wang/2020/06/03/pubmed資料探勘:rismed包/
問題網址:
https://githubhelp.com/skoval/RISmed
我也碰到同樣問題未解決:

執行程式碼記錄如下:

library(RISmed)
library("XML")
library("methods")

##限定下檢索主題
search_topic <- c('intracranial aneurysm' ) 

search_query <- EUtilsSummary(search_topic,db="pubmed", retmax=100,datetype='pdat', mindate=2019, maxdate=2020)

##查檢視下檢索內容
summary(search_query)

##看下這些文獻的Id
QueryId(search_query)

##獲取檢索結果
#Sys.sleep(0.1)
records <- EUtilsGet(search_query)
class(records)
str(records)
##提取檢索結果
pubmed_data <- data.frame('Title'=ArticleTitle(records),
                          'Year'=YearAccepted(records),
                          'journal'=ISOAbbreviation(records))

head(pubmed_data,1)
pubmed_data[1:3,1]
write.csv(pubmed_data,file='DNA_methylation_in_plant.csv')
##分析文章情況
y <- YearPubmed(EUtilsGet(search_query))
##視覺化一下
library(ggplot2)
date()
count <- table(y)
count <- as.data.frame(count)
names(count)<-c("Year", "Counts")
library(ggsci)
ggplot(data=count, aes(x=Year, y=Counts,fill=Year)) +
  geom_bar(stat="identity", width=0.5)+
  labs(y = "Number of articles",title="PubMed articles containing DNA methylation in plant"
  ) + theme_bw() + scale_fill_manual(values = colorRampPalette(brewer.pal(19, "Accent"))(19)) +
  theme(legend.position="bottom")

相關文章