R/combineabs.R

setGeneric("combineabs", function(object1,object2) standardGeneric("combineabs"))
setMethod("combineabs", "Abstracts", function(object1,object2){ newpmid <- union(object1@PMID, object2@PMID);   newjn <- NULL; newabs <- NULL; for (j in seq( along = newpmid)) {tempa <- newpmid[j]; tempb <- match(tempa, object1@PMID, nomatch = 0); if ( tempb !=0) {newjn <- c(newjn,object1@Journal[tempb]); newabs <- c(newabs,object1@Abstract[tempb])} else if (tempb == 0) {tempc <-  match(tempa, object2@PMID, nomatch = 0);  if ( tempc !=0) {newjn <- c(newjn,object2@Journal[tempc]); newabs <- c(newabs,object2@Abstract[tempc])}}}; result <- new("Abstracts", Journal = newjn, Abstract = newabs, PMID = newpmid);print(paste(length(result@PMID),"combined abstracts for above terms",sep = " ")); write(paste(length(result@PMID),"combined abstracts for above terms",sep = " "), file = "dataout.txt", append = T);        return(result)})

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.