R/Give_Sentences_PMC.R

Defines functions Give_Sentences_PMC

Documented in Give_Sentences_PMC

Give_Sentences_PMC = function(PMCID,term){
  check = getURL(paste("https://www.ncbi.nlm.nih.gov/pmc/articles/PMC", PMCID, "/", sep=""))
                 checkxml = htmlTreeParse(check,useInternalNodes = T)
                 check3 = lapply(getNodeSet(checkxml,"//p"),function(x){xmlValue(x)})
                 test = NULL; for (i in 1:length(check3)) {tempA = SentenceToken(check3[[i]]);tempB = regexpr(term,tempA); tempC = which(attr(tempB,"match.length") == nchar(term)); if ( length(tempC) != 0 ) tempD = tempA[tempC] else tempD = NULL; test = c(test,tempD)}; return(test)}

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.