write_pubmed_files: Save PubMed files

Description Usage Arguments Value Examples

View source: R/write_pubmed_files.R

Description

Save PubMed files as unparsed XML in ".txt" files, so that user can choose to parse with 'XML' or 'xml2' packages.

Usage

1
write_pubmed_files(pubmed_data, dir = here::here(), prefix = "")

Arguments

pubmed_data

Character vector of unparsed XML with root node "PubmedArticleSet". Generally the output of batch_fetch_pubmed_records.

dir

Directory to save files to. Default = current directory via here().

prefix

Prefix to append to filename (optional)

Value

SIDE-EFFECT. Unparsed XML in ".txt" files with batch number

Examples

1
2
3
4
5
6
7
8
9
my_dois <- c("10.1186/s12970-020-0336-1", "10.1016/S0140-6736(19)32971-X", "10.1056/NEJMoa1905239", "10.1371/journal.pone.0226893", "10.1016/S2352-3026(19)30207-8")

## Not run: 
batch_dois() %>%
create_query_strings() %>%
batch_fetch_pubmed_records() %>%
write_pubmed_files()

## End(Not run)

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