R/get_DOIs.R

get_DOIs = function (abs){ result = lapply(abs@Abstract,function(x){temp1 = SentenceToken(x); temp2 = grep("[Dd][Oo][Ii]: 10.[1234567890][1234567890][1234567890][1234567890]", temp1, value = T); temp3 = unlist(strsplit(temp2," ")); temp4 = regexpr("[Dd][Oo][Ii]:",temp3);temp5 = which(temp4 != -1);temp6 = temp5 + 1; temp7 = temp3[temp6];  temp8 = paste(temp3[temp5],temp7,sep = " ") ;if (length(temp8) != 0) { temp9 = unlist(lapply(temp8,function(x){if (substr(x,nchar(x),nchar(x)) == ".") return(substr(x,1,(nchar(x)-1))) else return(x)}));temp10 = toupper(temp9);temp11 = union(temp10,temp10) ;return(temp11)} else return("DOI Absent") })}

Try the pubmed.mineR package in your browser

Any scripts or data that you put into this service are public.

pubmed.mineR documentation built on Nov. 26, 2021, 5:11 p.m.