Last active
October 5, 2017 13:30
-
-
Save pkiraly/8d042e7053f8083ca6aad031f4a40df3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
original: | |
myPMCID <- function(x) { | |
if (x == "None") { | |
PMCID <- "None" | |
} else { | |
taxize_summ <- entrez_summary(db="pubmed", id=x) | |
PMC <- data.frame(taxize_summ$articleids) | |
PMC_ID <- grep("pmc-id:", PMC$value, value=TRUE) | |
if (identical(PMC_ID, character(0))) { | |
PMCID <- "None" | |
} else { | |
PMCID <- PMC_ID | |
} | |
} | |
return(PMCID) | |
} | |
suggestion: | |
myPMCID <- function(x) { | |
if (x == "None") { | |
PMCID <- "None" | |
} else { | |
taxize_summ <- entrez_summary(db="pubmed", id=x) | |
PMC <- data.frame(taxize_summ$articleids) | |
PMC_ID <- grep("pmc-id:", PMC$value, value=TRUE) | |
if (identical(PMC_ID, character(0))) { | |
PMCID <- "None" | |
} else { | |
PMCID <- PMC_ID | |
} | |
} | |
return(PMCID) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment