R2-35 第2阶段第4次

德先森 2018-04-23 08:49:08 阅读: 480

library("httr")

yeardata=c()

countdata=c()

url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi"

for (i in 1:10) {

  year=2007 +i

  term = paste('CRISPR[TI] AND ',year,'[DP]',sep = "")

  r<- POST(

    url,

    body = list(

      db='pubmed',

      term=term,

      retmode='json',

      retstart=0,

      retmax=10,

      rettype='uilist'

      )

   )

  stop_for_status(r)

  data=content(r,"parsed","application/json")

  esearchresult=data$esearchresult

  count=esearchresult$count

  yeardata=c(yeardata,year)

  countdata=c(countdata,count)

}

data=data.frame(year=yeardata,count=countdata)

print(data)

ggplot(data,aes(x=factor(year),y=count))+

 geom_bar(aes(fill=count),stat='identity',width = 0.8)

4-1.png4-2.png

 
请登录后再评论
| 注册
{{item.nickname}} {{item.create_time}} {{item.floor}}楼
{{item.re_nickname}} 写于 {{item.re_time}}
切换到完整回复
科研狗 2015-2020 京ICP备16006621 科研好助手,专业的科研社交共享平台