fetch_batches: Fetch batches of records

Description Usage Arguments Examples

View source: R/fetch_batches.R

Description

Batch IDs to account for Eutils server limits

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
fetch_batches(
  esearch,
  fetch_start = 1,
  fetch_end = NULL,
  batch_size = 10000,
  sleep_time = 0.2,
  dir = here::here(),
  file_name = esearch$QueryTranslation,
  quiet = FALSE,
  save_each_batch = TRUE,
  save_all_batches = FALSE
)

Arguments

esearch

Esearch object. Generally the output of search_get_pmids or check_update_esearch.

fetch_start

Record fetch should start with. Default to 1.

fetch_end

Record fetch should end with. Defaults to NULL and dynamically set to max of esearch query. @param batch_size Maximum batch size. Defaults to 10000, which is eutilities' limit. @param sleep_time Sleep between queries to respect server limits. Defaults to 0.2 seconds. @param dir Directory for saving files. Default to project root (here::here())

file_name

Root for file names. Default to esearch query.

quiet

Whether to silence messages in console. Defaults to FALSE.

save_each_batch

Whether each batch should be saved as raw characters to file. Defaults to TRUE.

save_all_batches

Whether all batches should be saved as vector of raw characters to file and nodeset. Defaults to FALSE (NOTE: This parameter is in development and should be set to FALSE.)

Examples

1
2
3
4
5
6
7
## Not run: 
# Run search and don't save any output
records_search <- search_get_pmids(term = "aquilegia[TITLE]",
                                   dir = NULL, output = NULL)
batch <- fetch_batches(records_search)

## End(Not run)

maia-sh/pubmedparser documentation built on Feb. 18, 2021, 11:44 a.m.