## Example 01: retrieve data in XML format, extract info, show
# Note: a time limit can be set in order to kill the operation when/if
# the NCBI/Entrez server becomes unresponsive.
setTimeLimit(elapsed = 4.9)
try({
my_query_string <- 'Damiano Fantini[AU] AND "2018"[PDAT]'
epm <- epm_query(my_query_string)
epm <- epm_fetch(epm)
epm <- epm_parse(epm, max_authors = 5, max_references = 10)
processed_data <- get_epm_data(epm)
utils::head(processed_data)
}, silent = TRUE)
setTimeLimit(elapsed = Inf)
if (FALSE) {
## Example 02: retrieve data in medline format
my_query_string <- 'Damiano Fantini[AU] AND "2018"[PDAT]'
epm <- epm_query(my_query_string)
epm <- epm_fetch(epm, format = 'medline')
medline_data <- get_epm_raw(epm)
first_record <- medline_data[[1]]
cat(first_record, sep = '\n')
## Additional Examples: show easyPubMed Vignette
library(easyPubMed)
vignette("easyPubMed_demo")
}
Run the code above in your browser using DataLab